# HG changeset patch # User cheesesucker@33b003aa-7bff-0310-803a-e67f0ece8222 # Date 1250359851 0 # Node ID a185aff3905146a0b6ff9f33dac25b80076d9590 # Parent 6add14ebe9f51c5285e57766e35583c003fb1ab7 Fixes crashes when attempting to draw/move when no layers are active diff -r 6add14ebe9f5 -r a185aff39051 clients/editor/scripts/gui/mapeditor.py --- a/clients/editor/scripts/gui/mapeditor.py Sat Aug 15 00:42:23 2009 +0000 +++ b/clients/editor/scripts/gui/mapeditor.py Sat Aug 15 18:10:51 2009 +0000 @@ -252,6 +252,10 @@ def mousePressed(self, sender, event): if event.isConsumedByWidgets(): return + + if not self._controller._layer: + if self._controller.debug: print 'No layers active. Cancelling map action' + return realCoords = self._getRealCoords(sender, event) @@ -330,6 +334,10 @@ if event.isConsumedByWidgets(): return + if not self._controller._layer: + if self._controller.debug: print 'No layers active. Cancelling map action' + return + realCoords = self._getRealCoords(sender, event) if event.getButton() == fife.MouseEvent.MIDDLE: @@ -384,6 +392,10 @@ if event.isConsumedByWidgets(): return + if not self._controller._layer: + if self._controller.debug: print 'No layers active. Cancelling map action' + return + if self._mode == SELECTING or self._mode == MOVING: instances = self._controller.getInstancesFromSelection() if len(instances) > 0: