changeset 516:4166a0051bb6

Reset cursor as well when changing tool. Avoid crash with non-default toolbar
author Neil Muller <drnlmuller@gmail.com>
date Fri, 27 Nov 2009 12:08:55 +0000
parents 88bda6db953a
children 05e0c3fd20ec
files gamelib/gameboard.py
diffstat 1 files changed, 3 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/gamelib/gameboard.py	Fri Nov 27 11:34:59 2009 +0000
+++ b/gamelib/gameboard.py	Fri Nov 27 12:08:55 2009 +0000
@@ -351,8 +351,9 @@
             self.sell_egg(self.tv.screen_to_tile(e.pos))
         elif self.selected_tool == constants.TOOL_PLACE_ANIMALS:
             self.place_animal(self.tv.screen_to_tile(e.pos))
-            self.selected_tool = constants.TOOL_SELECT_CHICKENS
-            self.toolbar.toggle_select_on()
+            self.set_selected_tool(constants.TOOL_SELECT_CHICKENS, cursors.cursors["select"])
+            if self.toolbar.IS_DEFAULT:
+                self.toolbar.toggle_select_on()
         elif self.selected_tool == constants.TOOL_SELECT_CHICKENS:
             # ctrl moves current selection without having to select move tool
             if (mods & KMOD_CTRL):