comparison clients/editor/scripts/mapview.py @ 321:7ddec4ce99b3

Fixed a crash when removing the layer which the editor camera uses
author cheesesucker@33b003aa-7bff-0310-803a-e67f0ece8222
date Sun, 16 Aug 2009 21:35:15 +0000
parents 0adf9423062e
children e249fa887259
comparison
equal deleted inserted replaced
320:2020053fffe0 321:7ddec4ce99b3
46 else: 46 else:
47 raise AttributeError('No cameras found associated with this map: ' + self._map.getId()) 47 raise AttributeError('No cameras found associated with this map: ' + self._map.getId())
48 48
49 def getCamera(self): 49 def getCamera(self):
50 return self._camera 50 return self._camera
51
52 def setCamera(self, camera):
53 if not camera:
54 print "Camera can not be None"
55 return
56
57 if camera.getLocation().getLayer().getMap() != self._map:
58 print "Camera is not associated with this map"
59 return
60
61 self._camera = None
51 62
52 def getController(self): 63 def getController(self):
53 return self._controller 64 return self._controller
54 65
55 def getMap(self): 66 def getMap(self):