comparison pytouhou/vm/eclrunner.py @ 91:f7525fa66bb0

Fix ECL instruction 3
author Thibaut Girka <thib@sitedethib.com>
date Sun, 04 Sep 2011 10:19:42 +0200
parents fda176f07d6d
children d167280a82fc
comparison
equal deleted inserted replaced
90:630e9045e851 91:f7525fa66bb0
164 relative offset in the same subroutine. 164 relative offset in the same subroutine.
165 165
166 Warning: the relative offset has been translated to an instruction pointer 166 Warning: the relative offset has been translated to an instruction pointer
167 by the ECL parsing code (see pytouhou.formats.ecl). 167 by the ECL parsing code (see pytouhou.formats.ecl).
168 """ 168 """
169 counter_value = self._getval(variable_id) 169 counter_value = self._getval(variable_id) - 1
170 if counter_value: 170 if counter_value > 0:
171 self._setval(variable_id, counter_value - 1) 171 self._setval(variable_id, counter_value)
172 self.frame, self.instruction_pointer = frame, instruction_pointer 172 self.frame, self.instruction_pointer = frame, instruction_pointer
173 173
174 174
175 @instruction(4) 175 @instruction(4)
176 @instruction(5) 176 @instruction(5)