From 423619b652d229a90ac97751736f30bbb50058e4 Mon Sep 17 00:00:00 2001 From: Rochet2 Date: Sat, 28 Jun 2014 00:31:14 +0300 Subject: [PATCH] Eluna switch to Lua 5.2.3 --- GameObjectMethods.h | 2 +- GlobalMethods.h | 26 +++++++++++++------------- UnitMethods.h | 2 +- 3 files changed, 15 insertions(+), 15 deletions(-) diff --git a/GameObjectMethods.h b/GameObjectMethods.h index 20901cb..675bab8 100644 --- a/GameObjectMethods.h +++ b/GameObjectMethods.h @@ -119,7 +119,7 @@ namespace LuaGameObject uint32 repeats = Eluna::CHECKVAL(L, 4); lua_pushvalue(L, 2); - int functionRef = lua_ref(L, true); + int functionRef = luaL_ref(L, LUA_REGISTRYINDEX); functionRef = sEluna->m_EventMgr->AddEvent(&go->m_Events, functionRef, delay, repeats, go); if (functionRef) Eluna::Push(L, functionRef); diff --git a/GlobalMethods.h b/GlobalMethods.h index f74766f..939c260 100644 --- a/GlobalMethods.h +++ b/GlobalMethods.h @@ -285,7 +285,7 @@ namespace LuaGlobalFunctions uint32 ev = Eluna::CHECKVAL(L, 2); luaL_checktype(L, 2, LUA_TFUNCTION); lua_pushvalue(L, 2); - int functionRef = lua_ref(L, true); + int functionRef = luaL_ref(L, LUA_REGISTRYINDEX); if (functionRef > 0) sEluna->Register(HookMgr::REGTYPE_PACKET, entry, ev, functionRef); return 0; @@ -296,7 +296,7 @@ namespace LuaGlobalFunctions uint32 ev = Eluna::CHECKVAL(L, 1); luaL_checktype(L, 2, LUA_TFUNCTION); lua_pushvalue(L, 2); - int functionRef = lua_ref(L, true); + int functionRef = luaL_ref(L, LUA_REGISTRYINDEX); if (functionRef > 0) sEluna->Register(HookMgr::REGTYPE_SERVER, 0, ev, functionRef); return 0; @@ -307,7 +307,7 @@ namespace LuaGlobalFunctions uint32 ev = Eluna::CHECKVAL(L, 1); luaL_checktype(L, 2, LUA_TFUNCTION); lua_pushvalue(L, 2); - int functionRef = lua_ref(L, true); + int functionRef = luaL_ref(L, LUA_REGISTRYINDEX); if (functionRef > 0) sEluna->Register(HookMgr::REGTYPE_PLAYER, 0, ev, functionRef); return 0; @@ -318,7 +318,7 @@ namespace LuaGlobalFunctions uint32 ev = Eluna::CHECKVAL(L, 1); luaL_checktype(L, 2, LUA_TFUNCTION); lua_pushvalue(L, 2); - int functionRef = lua_ref(L, true); + int functionRef = luaL_ref(L, LUA_REGISTRYINDEX); if (functionRef > 0) sEluna->Register(HookMgr::REGTYPE_GUILD, 0, ev, functionRef); return 0; @@ -329,7 +329,7 @@ namespace LuaGlobalFunctions uint32 ev = Eluna::CHECKVAL(L, 1); luaL_checktype(L, 2, LUA_TFUNCTION); lua_pushvalue(L, 2); - int functionRef = lua_ref(L, true); + int functionRef = luaL_ref(L, LUA_REGISTRYINDEX); if (functionRef > 0) sEluna->Register(HookMgr::REGTYPE_GROUP, 0, ev, functionRef); return 0; @@ -341,7 +341,7 @@ namespace LuaGlobalFunctions uint32 ev = Eluna::CHECKVAL(L, 2); luaL_checktype(L, 3, LUA_TFUNCTION); lua_pushvalue(L, 3); - int functionRef = lua_ref(L, true); + int functionRef = luaL_ref(L, LUA_REGISTRYINDEX); if (functionRef > 0) sEluna->Register(HookMgr::REGTYPE_CREATURE_GOSSIP, entry, ev, functionRef); return 0; @@ -353,7 +353,7 @@ namespace LuaGlobalFunctions uint32 ev = Eluna::CHECKVAL(L, 2); luaL_checktype(L, 3, LUA_TFUNCTION); lua_pushvalue(L, 3); - int functionRef = lua_ref(L, true); + int functionRef = luaL_ref(L, LUA_REGISTRYINDEX); if (functionRef > 0) sEluna->Register(HookMgr::REGTYPE_GAMEOBJECT_GOSSIP, entry, ev, functionRef); return 0; @@ -365,7 +365,7 @@ namespace LuaGlobalFunctions uint32 ev = Eluna::CHECKVAL(L, 2); luaL_checktype(L, 3, LUA_TFUNCTION); lua_pushvalue(L, 3); - int functionRef = lua_ref(L, true); + int functionRef = luaL_ref(L, LUA_REGISTRYINDEX); if (functionRef > 0) sEluna->Register(HookMgr::REGTYPE_ITEM, entry, ev, functionRef); return 0; @@ -377,7 +377,7 @@ namespace LuaGlobalFunctions uint32 ev = Eluna::CHECKVAL(L, 2); luaL_checktype(L, 3, LUA_TFUNCTION); lua_pushvalue(L, 3); - int functionRef = lua_ref(L, true); + int functionRef = luaL_ref(L, LUA_REGISTRYINDEX); if (functionRef > 0) sEluna->Register(HookMgr::REGTYPE_ITEM_GOSSIP, entry, ev, functionRef); return 0; @@ -389,7 +389,7 @@ namespace LuaGlobalFunctions uint32 ev = Eluna::CHECKVAL(L, 2); luaL_checktype(L, 3, LUA_TFUNCTION); lua_pushvalue(L, 3); - int functionRef = lua_ref(L, true); + int functionRef = luaL_ref(L, LUA_REGISTRYINDEX); if (functionRef > 0) sEluna->Register(HookMgr::REGTYPE_PLAYER_GOSSIP, menu_id, ev, functionRef); return 0; @@ -401,7 +401,7 @@ namespace LuaGlobalFunctions uint32 ev = Eluna::CHECKVAL(L, 2); luaL_checktype(L, 3, LUA_TFUNCTION); lua_pushvalue(L, 3); - int functionRef = lua_ref(L, true); + int functionRef = luaL_ref(L, LUA_REGISTRYINDEX); if (functionRef > 0) sEluna->Register(HookMgr::REGTYPE_CREATURE, entry, ev, functionRef); return 0; @@ -413,7 +413,7 @@ namespace LuaGlobalFunctions uint32 ev = Eluna::CHECKVAL(L, 2); luaL_checktype(L, 3, LUA_TFUNCTION); lua_pushvalue(L, 3); - int functionRef = lua_ref(L, true); + int functionRef = luaL_ref(L, LUA_REGISTRYINDEX); if (functionRef > 0) sEluna->Register(HookMgr::REGTYPE_GAMEOBJECT, entry, ev, functionRef); return 0; @@ -517,7 +517,7 @@ namespace LuaGlobalFunctions uint32 repeats = Eluna::CHECKVAL(L, 3); lua_pushvalue(L, 1); - int functionRef = lua_ref(L, true); + int functionRef = luaL_ref(L, LUA_REGISTRYINDEX); functionRef = sEluna->m_EventMgr->AddEvent(&sEluna->m_EventMgr->GlobalEvents, functionRef, delay, repeats); if (functionRef) Eluna::Push(L, functionRef); diff --git a/UnitMethods.h b/UnitMethods.h index 1f96d22..0f8b7d7 100644 --- a/UnitMethods.h +++ b/UnitMethods.h @@ -1568,7 +1568,7 @@ namespace LuaUnit uint32 repeats = Eluna::CHECKVAL(L, 4); lua_pushvalue(L, 2); - int functionRef = lua_ref(L, true); + int functionRef = luaL_ref(L, LUA_REGISTRYINDEX); functionRef = sEluna->m_EventMgr->AddEvent(&unit->m_Events, functionRef, delay, repeats, unit); if (functionRef) Eluna::Push(L, functionRef);