From cf3106ce28c92b85d4bbc590968e022eafd7ea05 Mon Sep 17 00:00:00 2001 From: Bill Currie Date: Mon, 17 Jan 2022 14:29:14 +0900 Subject: [PATCH] [gamecode] Correct call's mode selection Call's operand c is used to specify where the return value of the function is to be stored. This gets both the correct function being called, and the value being returned correctly. Test still fails due to the stack restoration issue. --- libs/gamecode/pr_exec.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libs/gamecode/pr_exec.c b/libs/gamecode/pr_exec.c index adf9cf515..d2f55dbd7 100644 --- a/libs/gamecode/pr_exec.c +++ b/libs/gamecode/pr_exec.c @@ -3141,7 +3141,7 @@ pr_exec_ruamoko (progs_t *pr, int exitdepth) case OP_CALL_B: case OP_CALL_C: case OP_CALL_D: - mm = pr_call_mode (pr, st, st->c & 3); + mm = pr_call_mode (pr, st, st_op - OP_CALL_B + 1); function = mm->func_var; pr->pr_argc = 0; // op_c specifies the location for the return value if any