changeset 74:c9818290bbe7

Objects that are not on an actual map are now stored under the value None in the gamestates object dictionary.
author KarstenBock@gmx.net
date Thu, 22 Sep 2011 14:39:00 +0200
parents 5c751b9a3d8b
children 9e03f7816061
files gamestate.py
diffstat 1 files changed, 2 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/gamestate.py	Thu Sep 22 14:29:28 2011 +0200
+++ b/gamestate.py	Thu Sep 22 14:39:00 2011 +0200
@@ -40,8 +40,7 @@
         @type object: GameObject
         """
         if not self.object_ids.has_key(object_id):
-            if map_id:
-                self.objects[map_id][object_id] = game_object
+            self.objects[map_id][object_id] = game_object
             self.object_ids[object_id] = map_id
     
     def deleteObject(self, object_id):
@@ -54,7 +53,7 @@
             if map_id:
                 inst = self.maps[map_id].agent_layer.getInstance(object_id)
                 self.maps[map_id].agent_layer.deleteInstance(inst)
-                del self.objects[map_id][object_id]
+            del self.objects[map_id][object_id]
             del self.object_ids[object_id]