- fixed initialization of default parameters in dynamically created function calls like in the MENUDEF parser

This commit is contained in:
Christoph Oelckers 2018-11-23 09:34:38 +01:00 committed by drfrag
parent 31f524fd6b
commit 1fd23f5228

View file

@ -644,7 +644,10 @@ int VMCallWithDefaults(VMFunction *func, TArray<VMValue> &params, VMReturn *resu
{
auto oldp = params.Size();
params.Resize(func->DefaultArgs.Size());
memcpy(&params[oldp], &func->DefaultArgs[oldp], (params.Size() - oldp) * sizeof(VMValue));
for (unsigned i = oldp; i < params.Size(); i++)
{
params[i] = func->DefaultArgs[i];
}
}
return VMCall(func, params.Data(), params.Size(), results, numresults);
}