Web   ·   Wiki   ·   Activities   ·   Blog   ·   Lists   ·   Chat   ·   Meeting   ·   Bugs   ·   Git   ·   Translate   ·   Archive   ·   People   ·   Donate
summaryrefslogtreecommitdiffstats
path: root/tools.py
diff options
context:
space:
mode:
Diffstat (limited to 'tools.py')
-rw-r--r--tools.py7
1 files changed, 4 insertions, 3 deletions
diff --git a/tools.py b/tools.py
index 7f3ef64..c20fdb8 100644
--- a/tools.py
+++ b/tools.py
@@ -36,9 +36,10 @@ class Tool(object):
self.game.setTool("destroy")
elif event.key == K_m:
self.game.setTool("magicpen")
- elif event.type == USEREVENT:
- # for switching tools
- self.game.setTool(event.action)
+ elif event.type == USEREVENT:
+ if hasattr(event,"action"):
+ if self.game.tools.has_key(event.action): self.game.setTool(event.action)
+
else:
# let the subclasses know that no events were handled yet
return False