Ignore:
Timestamp:
10/03/09 13:44:58 (10 years ago)
Author:
eliedebrauwer
Message:

Ticket #73: Patch by Elie De Brauwer, partial fix of load/save, this fixes the map load failure but does not fix the failure to load/save PC and NPC behaviour comment[s:trac, t:73]

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/game/scripts/world.py

    r294 r302  
    9898 
    9999    def loadMap(self, mapname, filename): 
    100         """Loads a map an stores it under the given name in the maps list. 
     100        """Loads a map and stores it under the given name in the maps list. 
     101           @type mapname: text 
     102           @param mapname: The name of the map to load  
     103           @type filename: text 
     104           @param filename: File which contains the map to be loaded 
     105           @return: None 
    101106        """ 
    102         map = Map(self.engine, self.data) 
    103          
    104         """Need to set active map before we load it because the map  
    105         loader uses call backs that expect to find an active map.  
    106         This needs to be reworked. 
    107         """ 
    108         self.maps[mapname] = map 
    109         self.setActiveMap(mapname) 
    110  
    111         map.load(filename) 
    112  
     107        if not mapname in self.maps: 
     108            """Need to set active map before we load it because the map  
     109            loader uses call backs that expect to find an active map.  
     110            This needs to be reworked. 
     111            """ 
     112            map = Map(self.engine, self.data) 
     113            self.maps[mapname] = map         
     114            self.setActiveMap(mapname) 
     115            map.load(filename) 
    113116     
    114117    def setActiveMap(self, mapname): 
    115118        """Sets the active map that is to be rendered. 
     119           @type mapname: text 
     120           @param mapname: The name of the map to load  
     121           @return: None 
    116122        """ 
    117123        self.activeMap = self.maps[mapname] 
Note: See TracChangeset for help on using the changeset viewer.