mirror of
https://github.com/luanti-org/luanti.git
synced 2025-10-16 18:05:22 +02:00
Clean up some getServer() unsafety
This commit is contained in:
@@ -56,10 +56,15 @@ EmergeScripting::EmergeScripting(EmergeThread *parent):
|
||||
|
||||
InitializeModApi(L, top);
|
||||
|
||||
auto *data = ModApiBase::getServer(L)->m_lua_globals_data.get();
|
||||
assert(data);
|
||||
script_unpack(L, data);
|
||||
lua_setfield(L, top, "transferred_globals");
|
||||
// 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");
|
||||
}
|
||||
|
||||
lua_pop(L, 1);
|
||||
|
||||
|
Reference in New Issue
Block a user