- marked all places where an incomplete parameter list may be passed to the VM by a native call by redirecting VMCall to an intermediate VMCallWithDefaults. This function must later fill in the missing arguments from the default.
This commit is contained in:
parent
acbdfddb26
commit
c24da62cdd
6 changed files with 16 additions and 11 deletions
|
|
@ -5448,7 +5448,7 @@ static int ScriptCall(AActor *activator, unsigned argc, int32_t *args)
|
|||
// The return value can be the same types as the parameter types, plus void
|
||||
if (func->Proto->ReturnTypes.Size() == 0)
|
||||
{
|
||||
VMCall(func, ¶ms[0], params.Size(), nullptr, 0);
|
||||
VMCallWithDefaults(func, ¶ms[0], params.Size(), nullptr, 0);
|
||||
}
|
||||
else
|
||||
{
|
||||
|
|
@ -5470,20 +5470,20 @@ static int ScriptCall(AActor *activator, unsigned argc, int32_t *args)
|
|||
{
|
||||
double d;
|
||||
VMReturn ret(&d);
|
||||
VMCall(func, ¶ms[0], params.Size(), &ret, 1);
|
||||
VMCallWithDefaults(func, ¶ms[0], params.Size(), &ret, 1);
|
||||
retval = DoubleToACS(d);
|
||||
}
|
||||
else if (rettype == TypeString)
|
||||
{
|
||||
FString d;
|
||||
VMReturn ret(&d);
|
||||
VMCall(func, ¶ms[0], params.Size(), &ret, 1);
|
||||
VMCallWithDefaults(func, ¶ms[0], params.Size(), &ret, 1);
|
||||
retval = GlobalACSStrings.AddString(d);
|
||||
}
|
||||
else
|
||||
{
|
||||
// All other return values can not be handled so ignore them.
|
||||
VMCall(func, ¶ms[0], params.Size(), nullptr, 0);
|
||||
VMCallWithDefaults(func, ¶ms[0], params.Size(), nullptr, 0);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue