# HG changeset patch # User Thibaut Girka # Date 1315124382 -7200 # Node ID f7525fa66bb03298496343d7cc92359aefa3b550 # Parent 630e9045e851e9c24e831c0081ae138dc0f4317e Fix ECL instruction 3 diff --git a/pytouhou/vm/eclrunner.py b/pytouhou/vm/eclrunner.py --- 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