diff pytouhou/game/game.py @ 336:72ef7e24b373

Fix MSG skipping.
author Thibaut Girka <thib@sitedethib.com>
date Sun, 01 Jul 2012 18:06:11 +0200
parents 2350147cf043
children 7a05edbab88a
line wrap: on
line diff
--- a/pytouhou/game/game.py
+++ b/pytouhou/game/game.py
@@ -258,10 +258,9 @@ class Game(object):
 
 
     def update_msg(self, keystate):
-        if keystate & 1 and not self.last_keystate & 1:
+        if any((keystate & k and not self.last_keystate & k) for k in (1, 256)):
             self.msg_runner.skip()
-        if keystate & 256 and self.msg_runner.allow_skip:
-            self.msg_runner.skip()
+        self.msg_runner.skipping = bool(keystate & 256)
         self.last_keystate = keystate
         self.msg_runner.run_iteration()