mirror of
https://github.com/azerothcore/mod-ale
synced 2025-11-29 15:38:17 +08:00
Move objects from global table to internal registery
This commit is contained in:
@@ -242,7 +242,7 @@ void Eluna::OpenLua()
|
||||
lua_pushstring(L, "v");
|
||||
lua_setfield(L, -2, "__mode");
|
||||
lua_setmetatable(L, -2);
|
||||
lua_setglobal(L, ELUNA_OBJECT_STORE);
|
||||
lua_setfield(L, LUA_REGISTRYINDEX, ELUNA_OBJECT_STORE);
|
||||
|
||||
// Set lua require folder paths (scripts folder structure)
|
||||
lua_getglobal(L, "package");
|
||||
@@ -534,7 +534,8 @@ void Eluna::RunScripts()
|
||||
|
||||
void Eluna::InvalidateObjects()
|
||||
{
|
||||
lua_getglobal(L, ELUNA_OBJECT_STORE);
|
||||
lua_pushstring(L, ELUNA_OBJECT_STORE);
|
||||
lua_rawget(L, LUA_REGISTRYINDEX);
|
||||
ASSERT(lua_istable(L, -1));
|
||||
|
||||
lua_pushnil(L);
|
||||
|
||||
Reference in New Issue
Block a user