# HG changeset patch # User Thibaut Girka # Date 1327368170 -3600 # Node ID b21acb12bed126005e858c03f0d029286e594a7a # Parent 80e73b8245a4d3c911bc46c8dc780cc7ad39abc9 Fix timeout handling diff -r 80e73b8245a4 -r b21acb12bed1 pytouhou/vm/eclrunner.py --- a/pytouhou/vm/eclrunner.py Tue Jan 24 00:56:31 2012 +0100 +++ b/pytouhou/vm/eclrunner.py Tue Jan 24 02:22:50 2012 +0100 @@ -173,9 +173,16 @@ self.sub = enm.timeout_callback self.instruction_pointer = 0 enm.timeout_callback = -1 - else: + elif enm.touchable: enm.life = 0 - #TODO: other callbacks (low life, etc.) + elif enm.death_callback >= 0: + self.frame = 0 + self.sub = enm.death_callback + self.instruction_pointer = 0 + enm.death_callback = -1 + enm.timeout = -1 #TODO: check + else: + raise Exception('What the hell, man!') def run_iteration(self):