[gamecode] Use version instead of locals count

It turned out I need locals count and params_start for debugging, so use
the progs version instead to bail early from PR_EnterFunction and
PR_LeaveFunction (which I had forgotten anyway, oops).
This commit is contained in:
Bill Currie 2022-01-27 11:24:00 +09:00
parent a0d9cf8d8e
commit 42db8514ae

View file

@ -233,7 +233,7 @@ PR_EnterFunction (progs_t *pr, bfunction_t *f)
pr->pr_xfunction = f;
pr->pr_xstatement = f->first_statement - 1; // offset the st++
if (!f->locals) {
if (pr->progs->version == PROG_VERSION) {
return;
}
@ -334,6 +334,10 @@ PR_LeaveFunction (progs_t *pr, int to_engine)
}
}
if (pr->progs->version == PROG_VERSION) {
return;
}
// restore locals from the stack
pr->localstack_used -= f->locals;
if (pr->localstack_used < 0)