From 96202a5984ad4f3ccaa6412beec0fcc9f420a7f9 Mon Sep 17 00:00:00 2001 From: Bill Currie Date: Sun, 24 Aug 2003 07:23:12 +0000 Subject: [PATCH] bah, forgot to -1 the instruction pointer for jumpb --- libs/gamecode/engine/pr_exec.c | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/libs/gamecode/engine/pr_exec.c b/libs/gamecode/engine/pr_exec.c index c7c690e4b..10d94f7f3 100644 --- a/libs/gamecode/engine/pr_exec.c +++ b/libs/gamecode/engine/pr_exec.c @@ -136,7 +136,7 @@ PR_EnterFunction (progs_t * pr, dfunction_t *f) } pr->pr_xfunction = f; - pr->pr_xstatement = f->first_statement - 1; // offset the s++ + pr->pr_xstatement = f->first_statement - 1; // offset the st++ return; } @@ -601,42 +601,42 @@ PR_ExecuteProgram (progs_t * pr, func_t fnum) // ================== case OP_IFNOT: if (!OPA.integer_var) { - pr->pr_xstatement += (short)st->b - 1; // offset the s++ + pr->pr_xstatement += (short)st->b - 1; // offset the st++ st = pr->pr_statements + pr->pr_xstatement; } break; case OP_IF: if (OPA.integer_var) { - pr->pr_xstatement += (short)st->b - 1; // offset the s++ + pr->pr_xstatement += (short)st->b - 1; // offset the st++ st = pr->pr_statements + pr->pr_xstatement; } break; case OP_IFBE: if (OPA.integer_var <= 0) { - pr->pr_xstatement += (short)st->b - 1; // offset the s++ + pr->pr_xstatement += (short)st->b - 1; // offset the st++ st = pr->pr_statements + pr->pr_xstatement; } break; case OP_IFB: if (OPA.integer_var < 0) { - pr->pr_xstatement += (short)st->b - 1; // offset the s++ + pr->pr_xstatement += (short)st->b - 1; // offset the st++ st = pr->pr_statements + pr->pr_xstatement; } break; case OP_IFAE: if (OPA.integer_var >= 0) { - pr->pr_xstatement += (short)st->b - 1; // offset the s++ + pr->pr_xstatement += (short)st->b - 1; // offset the st++ st = pr->pr_statements + pr->pr_xstatement; } break; case OP_IFA: if (OPA.integer_var > 0) { - pr->pr_xstatement += (short)st->b - 1; // offset the s++ + pr->pr_xstatement += (short)st->b - 1; // offset the st++ st = pr->pr_statements + pr->pr_xstatement; } break; case OP_GOTO: - pr->pr_xstatement += (short)st->a - 1; // offset the s++ + pr->pr_xstatement += (short)st->a - 1; // offset the st++ st = pr->pr_statements + pr->pr_xstatement; break; case OP_JUMP: @@ -656,7 +656,7 @@ PR_ExecuteProgram (progs_t * pr, func_t fnum) && (pointer >= pr->progs->numstatements)) { PR_RunError (pr, "Invalid jump destination"); } - pr->pr_xstatement = pointer; + pr->pr_xstatement = pointer - 1; // offset the st++ st = pr->pr_statements + pr->pr_xstatement; break;