changeset 91:f7525fa66bb0

Fix ECL instruction 3
author Thibaut Girka <thib@sitedethib.com>
date Sun, 04 Sep 2011 10:19:42 +0200
parents 630e9045e851
children 85f3b8ba3f24
files pytouhou/vm/eclrunner.py
diffstat 1 files changed, 3 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/pytouhou/vm/eclrunner.py
+++ b/pytouhou/vm/eclrunner.py
@@ -166,9 +166,9 @@ class ECLRunner(object):
         Warning: the relative offset has been translated to an instruction pointer
         by the ECL parsing code (see pytouhou.formats.ecl).
         """
-        counter_value = self._getval(variable_id)
-        if counter_value:
-            self._setval(variable_id, counter_value - 1)
+        counter_value = self._getval(variable_id) - 1
+        if counter_value > 0:
+            self._setval(variable_id, counter_value)
             self.frame, self.instruction_pointer = frame, instruction_pointer