Optimize void return in squirrel function call stub

This commit is contained in:
Alexander 'z33ky' Hirsch 2024-11-18 15:11:43 +01:00
parent 1ecaa44c49
commit 8e8bdfc371

View File

@ -1429,8 +1429,15 @@ SQInteger function_stub(HSQUIRRELVM vm)
{
Assert(script_retval.m_type == pFunc->m_desc.m_ReturnType);
PushVariant(vm, script_retval);
sq_retval = 1;
if (pFunc->m_desc.m_ReturnType != FIELD_VOID)
{
PushVariant(vm, script_retval);
sq_retval = 1;
}
else
{
sq_retval = 0;
}
}
// strings never get copied here, Vector and QAngle are stored in script_retval_storage