Mercurial > parpg-core
diff src/parpg/gamemodel.py @ 157:db6403c1a7a1
Fixed that dropped items cannot be picked up.
author | KarstenBock@gmx.net |
---|---|
date | Fri, 07 Oct 2011 14:36:36 +0200 |
parents | 7214224b8d83 |
children | d1f9652d0651 |
line wrap: on
line diff
--- a/src/parpg/gamemodel.py Fri Oct 07 14:16:21 2011 +0200 +++ b/src/parpg/gamemodel.py Fri Oct 07 14:36:36 2011 +0200 @@ -669,15 +669,17 @@ def updateObjectDB(self, world): """Updates the values in the object database with the worlds values""" + all_agents = self.agents[self.ALL_AGENTS_KEY] for entity in world.entities: identifier = entity.general.identifier agent_data = {} map_id = self.game_state.getMapOfObject(identifier) if map_id: - if self.agents[self.ALL_AGENTS_KEY].has_key(identifier): + if all_agents.has_key(identifier): agent_data = self.agents[self.ALL_AGENTS_KEY][identifier] else: agent_data = self.agents[map_id][identifier] + else: if not self.items.has_key(identifier): self.items[identifier] = {} @@ -704,7 +706,8 @@ inst = layer.getInstance(identifier) loc = inst.getLocation().getExactLayerCoordinates() agent_data["Position"] = (loc.x, loc.y, loc.z) - agent_data["Map"] = map_id + if all_agents.has_key(identifier): + agent_data["Map"] = map_id agent_data["Rotation"] = inst.getRotation() elif name == "container" and hasattr(comp_vals, "children"):