mirror of
https://github.com/luanti-org/luanti.git
synced 2025-06-27 16:36:03 +00:00
Fix object reference pushing functions when called from coroutines
This commit is contained in:
parent
28438bba27
commit
741df993ff
10 changed files with 42 additions and 45 deletions
|
@ -375,7 +375,7 @@ int ModApiEnvMod::l_add_entity(lua_State *L)
|
|||
if(objectid == 0)
|
||||
return 0;
|
||||
// Return ObjectRef
|
||||
getScriptApiBase(L)->objectrefGetOrCreate(obj);
|
||||
getScriptApiBase(L)->objectrefGetOrCreate(L, obj);
|
||||
return 1;
|
||||
}
|
||||
|
||||
|
@ -440,7 +440,7 @@ int ModApiEnvMod::l_get_player_by_name(lua_State *L)
|
|||
return 1;
|
||||
}
|
||||
// Put player on stack
|
||||
getScriptApiBase(L)->objectrefGetOrCreate(sao);
|
||||
getScriptApiBase(L)->objectrefGetOrCreate(L, sao);
|
||||
return 1;
|
||||
}
|
||||
|
||||
|
@ -459,7 +459,7 @@ int ModApiEnvMod::l_get_objects_inside_radius(lua_State *L)
|
|||
for(u32 i = 0; iter != ids.end(); iter++) {
|
||||
ServerActiveObject *obj = env->getActiveObject(*iter);
|
||||
// Insert object reference into table
|
||||
script->objectrefGetOrCreate(obj);
|
||||
script->objectrefGetOrCreate(L, obj);
|
||||
lua_rawseti(L, -2, ++i);
|
||||
}
|
||||
return 1;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue