changeset 136:9397f3e4516d

Fixed UseAction.
author KarstenBock@gmx.net
date Sun, 09 Oct 2011 13:31:08 +0200
parents 9e86c37f5506
children 53faff63037f
files objects/action.py
diffstat 1 files changed, 8 insertions(+), 7 deletions(-) [+]
line wrap: on
line diff
--- 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):