# HG changeset patch # User KarstenBock@gmx.net # Date 1318159868 -7200 # Node ID 7f044776de60f010dc3aa9fd62c31e61f2cfed06 # Parent 6d07093e9d51fc0c84900dc4c67d9832f5a8ba45 Fixed UseAction. diff -r 6d07093e9d51 -r 7f044776de60 src/parpg/objects/action.py --- a/src/parpg/objects/action.py Sat Oct 08 14:25:48 2011 +0200 +++ b/src/parpg/objects/action.py Sun Oct 09 13:31:08 2011 +0200 @@ -392,13 +392,14 @@ if command == "ReplaceItem": object_id = command_data["ID"] object_type = command_data["ObjectType"] - container = self.item.in_container - inst_dict = {} - inst_dict["ID"] = object_id - inst_dict["object_type"] = object_type - new_item = self.model.createContainerObject(inst_dict) - container.replaceItem(self.item, new_item) - self.view.hud.inventory.updateInventoryButtons() + containable = self.item.containable + new_item = self.model.createItemByType(object_type, + object_id, + self.item.world) + container.put_item(containable.container, + new_item.containable, + containable.slot) + self.view.hud.inventory.updateImages() super(UseAction, self).execute() class PickUpAction(Action):