[gamecode] Improve watchpoint handling a little

Mostly just update the old value if the condition didn't trigger.
This commit is contained in:
Bill Currie 2020-03-24 13:26:35 +09:00
parent 753d183d82
commit 1d6843d7f0

View file

@ -1698,11 +1698,14 @@ op_call:
default:
PR_RunError (pr, "Bad opcode %i", st->op);
}
if (watch && watch->integer_var != old_val.integer_var
&& (!pr->wp_conditional
|| watch->integer_var == pr->wp_val.integer_var))
PR_RunError (pr, "watchpoint hit: %d -> %d", old_val.integer_var,
watch->integer_var);
if (watch && watch->integer_var != old_val.integer_var) {
if (!pr->wp_conditional
|| watch->integer_var == pr->wp_val.integer_var) {
PR_RunError (pr, "watchpoint hit: %d -> %d",
old_val.integer_var, watch->integer_var);
}
old_val.integer_var = watch->integer_var;
}
}
exit_program:
pr->pr_argc = 0;