From 078f36a871a0cd244681aded6d48f848ad0d33c9 Mon Sep 17 00:00:00 2001 From: Bill Currie Date: Sat, 5 Feb 2022 18:42:54 +0900 Subject: [PATCH] [gamecode] Add "return pointer" mode to with instruction This loads the current return pointer into the specified register. No offset is used (should make that an error, but for now any offset is simply ignored). This is part of the fix for getting obj_msg_sendv to work with return values. --- libs/gamecode/pr_exec.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/libs/gamecode/pr_exec.c b/libs/gamecode/pr_exec.c index 4bbf3ca81..bd3879431 100644 --- a/libs/gamecode/pr_exec.c +++ b/libs/gamecode/pr_exec.c @@ -1989,6 +1989,10 @@ pr_with (progs_t *pr, const dstatement_t *st) // reset pr->pr_bases = (pr_uivec4_t) {}; return; + case 11: + // return pointer + *base = pr->pr_return - pr->pr_globals; + return; } PR_RunError (pr, "Invalid with index: %u", st->a); }