1
0
Fork 0
mirror of https://github.com/luanti-org/luanti.git synced 2025-08-31 18:31:04 +00:00

Revert "Clean up some getServer() unsafety"

Turned out to not be a good idea.
This reverts commit 58eccc7a2a.
This commit is contained in:
sfan5 2024-04-28 00:24:22 +02:00
parent 73dbd2f0ab
commit df4c9e2903
3 changed files with 8 additions and 15 deletions

View file

@ -56,15 +56,10 @@ EmergeScripting::EmergeScripting(EmergeThread *parent):
InitializeModApi(L, top);
// pull the globals data from the server
{
auto *server = dynamic_cast<Server*>(ModApiBase::getGameDef(L));
assert(server);
auto *data = server->m_lua_globals_data.get();
assert(data);
script_unpack(L, data);
lua_setfield(L, top, "transferred_globals");
}
auto *data = ModApiBase::getServer(L)->m_lua_globals_data.get();
assert(data);
script_unpack(L, data);
lua_setfield(L, top, "transferred_globals");
lua_pop(L, 1);