changeset 108:81b51b9d861e

Fixed bug where the objects of a map where not correctly restored when changing between maps.
author KarstenBock@gmx.net
date Fri, 30 Sep 2011 16:05:26 +0200
parents 100a39fa64a2
children 8d87e1203402
files gamemodel.py gamescenecontroller.py
diffstat 2 files changed, 2 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/gamemodel.py	Fri Sep 30 15:31:53 2011 +0200
+++ b/gamemodel.py	Fri Sep 30 16:05:26 2011 +0200
@@ -540,6 +540,8 @@
         self.active_map = self.game_state.maps[map_name]
         self.active_map.makeActive()
         self.game_state.current_map_name = map_name
+        if not self.agents.has_key(map_name):
+            self.readAgentsOfMap(map_name)
 
     def createMapObject (self, layer, attributes, inst_id, world):
         """Create an object and add it to the current map.
--- a/gamescenecontroller.py	Fri Sep 30 15:31:53 2011 +0200
+++ b/gamescenecontroller.py	Fri Sep 30 16:05:26 2011 +0200
@@ -355,7 +355,6 @@
             self.model.loadMap(self.model.target_map_name)
             
             self.model.setActiveMap(self.model.target_map_name)          
-            self.model.readAgentsOfMap(self.model.target_map_name)
             
             self.model.placeAgents(self)
             self.model.placePC(self)