File tree Expand file tree Collapse file tree 1 file changed +12
-1
lines changed
Expand file tree Collapse file tree 1 file changed +12
-1
lines changed Original file line number Diff line number Diff line change @@ -737,7 +737,18 @@ namespace RC::LuaType
737737 if (params.lua .is_userdata (params.stored_at_index ))
738738 {
739739 // StructData as userdata
740- params.throw_error (" push_structproperty::lua_to_memory" , " StructData as userdata is not yet implemented but there's userdata on the stack" );
740+ auto & lua_scriptstruct = params.lua .get_userdata <UScriptStruct>().get_local_cpp_object ();
741+ if (lua_scriptstruct.script_struct == script_struct)
742+ {
743+ struct_property->CopyCompleteValue (params.data , lua_scriptstruct.get_data_ptr ());
744+ }
745+ else
746+ {
747+ params.throw_error (" push_structproperty::lua_to_memory" ,
748+ fmt::format (" Can't copy struct of type {} into {}" ,
749+ to_string (lua_scriptstruct.script_struct ->GetName ()),
750+ to_string (script_struct->GetName ())));
751+ }
741752 }
742753 else if (params.lua .is_table (params.stored_at_index ))
743754 {
You can’t perform that action at this time.
0 commit comments