# HG changeset patch # User KarstenBock@gmx.net # Date 1316783342 -7200 # Node ID a85d58fcd2530127ee3d193c9f8447f752b187c1 # Parent b10d12fbbb3fd2d2cf861279b1f848060c1a34ba Fixed PickUpAction. Items can be picked up again. diff -r b10d12fbbb3f -r a85d58fcd253 src/parpg/objects/action.py --- a/src/parpg/objects/action.py Fri Sep 23 15:08:27 2011 +0200 +++ b/src/parpg/objects/action.py Fri Sep 23 15:09:02 2011 +0200 @@ -21,6 +21,8 @@ from parpg.gui import drag_drop_data as data_drag from parpg.dialoguecontroller import DialogueController +from parpg.components import container + class NoSuchQuestException(Exception): """NoQuestException is used when there is no active quest with the id""" @@ -373,17 +375,16 @@ class PickUpAction(Action): """Action for picking up items from a map""" - def __init__(self, controller, map_item, commands = None): + def __init__(self, controller, item, commands = None): super(PickUpAction, self).__init__(controller, commands) - self.map_item = map_item + self.item = item self.view = controller.view def execute(self): - real_item = self.map_item.item - self.model.deleteObject(self.map_item.ID) - self.model.game_state.getObjectById("PlayerCharacter").fifeagent.\ - inventory.placeItem(real_item) - self.view.hud.inventory.updateInventoryButtons() + real_item = self.item.containable + player = self.model.game_state.getObjectById("PlayerCharacter") + self.model.moveObject(self.item.fifeagent.identifier, None) + container.put_item(player.container, real_item) super(PickUpAction, self).execute() class DropItemAction(Action):