Mercurial > parpg-core
comparison 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 |
comparison
equal
deleted
inserted
replaced
165:6d07093e9d51 | 166:7f044776de60 |
---|---|
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 |