+
+def cmd_THING_DOOR_KEY(game, key_id, door_id):
+ key = game.get_thing(key_id)
+ if not key:
+ raise GameError('thing of ID %s not found' % key_id)
+ if key.type_ != 'DoorKey':
+ raise GameError('thing of ID %s not a door key' % key_id)
+ door = game.get_thing(door_id)
+ if not door:
+ raise GameError('thing of ID %s not found' % door_id)
+ if door.type_ != 'Door':
+ raise GameError('thing of ID %s not a door' % key_id)
+ key.door = door
+cmd_THING_DOOR_KEY.argtypes = 'int:pos int:pos'