From b663fecd4ea5f4dcfe79af38625247f0329efacb Mon Sep 17 00:00:00 2001 From: Bill Currie Date: Mon, 24 Jan 2022 16:46:49 +0900 Subject: [PATCH] [gamecode] Use PR_SetupParameters for rua called builtins It's a bit heavy-handed as it sets all the param pointers, but simple (no varargs) functions are working nicely in Ruamoko. --- libs/gamecode/pr_exec.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/libs/gamecode/pr_exec.c b/libs/gamecode/pr_exec.c index a78b01f9a..519808418 100644 --- a/libs/gamecode/pr_exec.c +++ b/libs/gamecode/pr_exec.c @@ -439,6 +439,9 @@ PR_CallFunction (progs_t *pr, pr_func_t fnum, pr_type_t *return_ptr) f = pr->function_table + fnum; if (f->first_statement < 0) { // negative statements are built in functions + if (pr->progs->version == PROG_VERSION) { + PR_SetupParams (pr, 0, 0); + } if (pr->pr_trace && !pr->debug_handler) { Sys_Printf ("Calling builtin %s @ %p\n", PR_GetString (pr, f->descriptor->name), f->func);