diff options
author | Alex <alex@Tiresias.(none)> | 2008-07-09 21:58:55 (GMT) |
---|---|---|
committer | Alex <alex@Tiresias.(none)> | 2008-07-09 21:58:55 (GMT) |
commit | 86f033b7a6f02cb2c3f12f39c751b88b926f0e6c (patch) | |
tree | bc4c08a16c2327d3b8e17cf15dc3ecbb71dedd53 /tools.py | |
parent | a82f16ddf77103d789d7ac81e86b58713d720bc6 (diff) |
Menus now work
Diffstat (limited to 'tools.py')
-rw-r--r-- | tools.py | 7 |
1 files changed, 4 insertions, 3 deletions
@@ -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 |