From da90f839cfe4e350e917bac0cb5743949787b218 Mon Sep 17 00:00:00 2001 From: Kevin Caccamo Date: Fri, 15 Jan 2021 12:30:44 -0500 Subject: [PATCH] Fix ScriptCall missing default arguments There was one VMCall in DLevelScript::ScriptCall that didn't use default arguments. This was causing assertion failures in the GZDoom debug build when trying to run Wolfenstein: Blade of Agony on any map that wasn't TITLEMAP, because ACSTools.FindInventoryClass returns a boolean, and it has a default argument. --- src/p_acs.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/p_acs.cpp b/src/p_acs.cpp index c6291bffd..eced90f4e 100644 --- a/src/p_acs.cpp +++ b/src/p_acs.cpp @@ -5381,7 +5381,7 @@ static int ScriptCall(AActor *activator, unsigned argc, int32_t *args) if (rettype == TypeSInt32 || rettype == TypeBool || rettype == TypeColor || rettype == TypeName || rettype == TypeSound) { VMReturn ret(&retval); - VMCall(func, ¶ms[0], params.Size(), &ret, 1); + VMCallWithDefaults(func, params, &ret, 1); if (rettype == TypeName) { retval = GlobalACSStrings.AddString(FName(ENamedName(retval)));