Skip to content

Commit 5024bd0

Browse files
committed
scripting:lua: clear out entire return value for pointer values
1 parent 3909d11 commit 5024bd0

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

code/components/citizen-scripting-lua/src/LuaScriptRuntime.cpp

+5
Original file line numberDiff line numberDiff line change
@@ -754,12 +754,17 @@ int Lua_InvokeNative(lua_State* L)
754754
}
755755

756756
// push the offset and set the type
757+
retvals[numReturnValues] = 0;
758+
757759
push(&retvals[numReturnValues]);
758760
rettypes[numReturnValues] = metaField;
759761

760762
// increment the counter
761763
if (metaField == LuaMetaFields::PointerValueVector)
762764
{
765+
retvals[numReturnValues + 1] = 0;
766+
retvals[numReturnValues + 2] = 0;
767+
763768
numReturnValues += 3;
764769
}
765770
else

0 commit comments

Comments
 (0)