# HG changeset patch # User Emmanuel Gil Peyrot # Date 1566520619 -7200 # Node ID 600eb0a69b25d8dfc666b6f93597c44e237e8396 # Parent 7ae576a418ff2b6f576a23d2c928ebe1cd2e63ae ecl_vm: fix RelativeJump* instructions to actually call RelativeJump. diff --git a/src/th06/ecl_vm.rs b/src/th06/ecl_vm.rs --- a/src/th06/ecl_vm.rs +++ b/src/th06/ecl_vm.rs @@ -256,7 +256,7 @@ impl EclRunner { // TODO: counter_value is a field of "enemy" in th06, to check let counter_value = self.get_i32(var_id) - 1; if counter_value > 0 { - SubInstruction::RelativeJump(frame, ip); + self.run_instruction(SubInstruction::RelativeJump(frame, ip)); } } // 4 @@ -407,37 +407,37 @@ impl EclRunner { // 29 SubInstruction::RelativeJumpIfLowerThan(frame, ip) => { if self.frame.comparison_reg == -1 { - SubInstruction::RelativeJump(frame, ip); + self.run_instruction(SubInstruction::RelativeJump(frame, ip)); } } // 30 SubInstruction::RelativeJumpIfLowerOrEqual(frame, ip) => { if self.frame.comparison_reg != 1 { - SubInstruction::RelativeJump(frame, ip); + self.run_instruction(SubInstruction::RelativeJump(frame, ip)); } } // 31 SubInstruction::RelativeJumpIfEqual(frame, ip) => { if self.frame.comparison_reg == 0 { - SubInstruction::RelativeJump(frame, ip); + self.run_instruction(SubInstruction::RelativeJump(frame, ip)); } } // 32 SubInstruction::RelativeJumpIfGreaterThan(frame, ip) => { if self.frame.comparison_reg == 1 { - SubInstruction::RelativeJump(frame, ip); + self.run_instruction(SubInstruction::RelativeJump(frame, ip)); } } // 33 SubInstruction::RelativeJumpIfGreaterOrEqual(frame, ip) => { if self.frame.comparison_reg != -1 { - SubInstruction::RelativeJump(frame, ip); + self.run_instruction(SubInstruction::RelativeJump(frame, ip)); } } // 34 SubInstruction::RelativeJumpIfNotEqual(frame, ip) => { if self.frame.comparison_reg != 0 { - SubInstruction::RelativeJump(frame, ip); + self.run_instruction(SubInstruction::RelativeJump(frame, ip)); } } // 35