# HG changeset patch # User KarstenBock@gmx.net # Date 1317388133 -7200 # Node ID e1fd4cda237d0c7ce1a6fd7e793e6536d0d7a703 # Parent e28c13a4802a917a47945c8a0bfc145ba3c43091 Added optional Slot value to the "Items" list in the agents file. updateObjectDB now saves the slot of the item diff -r e28c13a4802a -r e1fd4cda237d src/parpg/gamemodel.py --- a/src/parpg/gamemodel.py Fri Sep 30 14:11:02 2011 +0200 +++ b/src/parpg/gamemodel.py Fri Sep 30 15:08:53 2011 +0200 @@ -422,6 +422,7 @@ items = inv["Items"] if inv.has_key("Items") else list() for data in items: item = None + slot = data["Slot"] if data.has_key("Slot") else -1 if data.has_key("type"): item_type = data["type"] item_data = {} @@ -442,7 +443,7 @@ item = self.create_item(identifier, item_data, world, item_type) - container.put_item(obj.container, item.containable) + container.put_item(obj.container, item.containable, slot) if agent.has_key("Equipment"): for slot, data in agent["Equipment"].iteritems(): @@ -700,7 +701,8 @@ if not child: continue items.append( - {"ID": child.entity.general.identifier} + {"ID": child.entity.general.identifier, + "Slot": child.slot} ) inventory_data["Items"] = items agent_data["Inventory"] = inventory_data