comparison objects/action.py @ 136:9397f3e4516d

Fixed UseAction.
author KarstenBock@gmx.net
date Sun, 09 Oct 2011 13:31:08 +0200
parents 73b7188a461d
children 658e06a20fa5
comparison
equal deleted inserted replaced
135:9e86c37f5506 136:9397f3e4516d
390 for command_data in self.commands: 390 for command_data in self.commands:
391 command = command_data["Command"] 391 command = command_data["Command"]
392 if command == "ReplaceItem": 392 if command == "ReplaceItem":
393 object_id = command_data["ID"] 393 object_id = command_data["ID"]
394 object_type = command_data["ObjectType"] 394 object_type = command_data["ObjectType"]
395 container = self.item.in_container 395 containable = self.item.containable
396 inst_dict = {} 396 new_item = self.model.createItemByType(object_type,
397 inst_dict["ID"] = object_id 397 object_id,
398 inst_dict["object_type"] = object_type 398 self.item.world)
399 new_item = self.model.createContainerObject(inst_dict) 399 container.put_item(containable.container,
400 container.replaceItem(self.item, new_item) 400 new_item.containable,
401 self.view.hud.inventory.updateInventoryButtons() 401 containable.slot)
402 self.view.hud.inventory.updateImages()
402 super(UseAction, self).execute() 403 super(UseAction, self).execute()
403 404
404 class PickUpAction(Action): 405 class PickUpAction(Action):
405 """Action for picking up items from a map""" 406 """Action for picking up items from a map"""
406 407