# HG changeset patch # User Thibaut Girka # Date 1327368170 -3600 # Node ID b21acb12bed126005e858c03f0d029286e594a7a # Parent 80e73b8245a4d3c911bc46c8dc780cc7ad39abc9 Fix timeout handling diff --git a/pytouhou/vm/eclrunner.py b/pytouhou/vm/eclrunner.py --- a/pytouhou/vm/eclrunner.py +++ b/pytouhou/vm/eclrunner.py @@ -173,9 +173,16 @@ class ECLRunner(object): 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):