diff src/parpg/objects/action.py @ 166:7f044776de60

Fixed UseAction.
author KarstenBock@gmx.net
date Sun, 09 Oct 2011 13:31:08 +0200
parents ede6f6b31bf8
children 7f03365c098d
line wrap: on
line diff
--- 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):