# HG changeset patch # User KarstenBock@gmx.net # Date 1318159868 -7200 # Node ID 9397f3e4516dae29c5a3ce988ffcd9f4823593a2 # Parent 9e86c37f550669548b30ca6bc131aadd26ff97ac Fixed UseAction. diff -r 9e86c37f5506 -r 9397f3e4516d objects/action.py --- a/objects/action.py Sat Oct 08 14:25:48 2011 +0200 +++ b/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):