Eluna switch to Lua 5.2.3

This commit is contained in:
Rochet2
2014-06-28 00:31:14 +03:00
committed by Foereaper
parent 6cd2ed2b6f
commit 423619b652
3 changed files with 15 additions and 15 deletions

View File

@@ -119,7 +119,7 @@ namespace LuaGameObject
uint32 repeats = Eluna::CHECKVAL<uint32>(L, 4); uint32 repeats = Eluna::CHECKVAL<uint32>(L, 4);
lua_pushvalue(L, 2); 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); functionRef = sEluna->m_EventMgr->AddEvent(&go->m_Events, functionRef, delay, repeats, go);
if (functionRef) if (functionRef)
Eluna::Push(L, functionRef); Eluna::Push(L, functionRef);

View File

@@ -285,7 +285,7 @@ namespace LuaGlobalFunctions
uint32 ev = Eluna::CHECKVAL<uint32>(L, 2); uint32 ev = Eluna::CHECKVAL<uint32>(L, 2);
luaL_checktype(L, 2, LUA_TFUNCTION); luaL_checktype(L, 2, LUA_TFUNCTION);
lua_pushvalue(L, 2); lua_pushvalue(L, 2);
int functionRef = lua_ref(L, true); int functionRef = luaL_ref(L, LUA_REGISTRYINDEX);
if (functionRef > 0) if (functionRef > 0)
sEluna->Register(HookMgr::REGTYPE_PACKET, entry, ev, functionRef); sEluna->Register(HookMgr::REGTYPE_PACKET, entry, ev, functionRef);
return 0; return 0;
@@ -296,7 +296,7 @@ namespace LuaGlobalFunctions
uint32 ev = Eluna::CHECKVAL<uint32>(L, 1); uint32 ev = Eluna::CHECKVAL<uint32>(L, 1);
luaL_checktype(L, 2, LUA_TFUNCTION); luaL_checktype(L, 2, LUA_TFUNCTION);
lua_pushvalue(L, 2); lua_pushvalue(L, 2);
int functionRef = lua_ref(L, true); int functionRef = luaL_ref(L, LUA_REGISTRYINDEX);
if (functionRef > 0) if (functionRef > 0)
sEluna->Register(HookMgr::REGTYPE_SERVER, 0, ev, functionRef); sEluna->Register(HookMgr::REGTYPE_SERVER, 0, ev, functionRef);
return 0; return 0;
@@ -307,7 +307,7 @@ namespace LuaGlobalFunctions
uint32 ev = Eluna::CHECKVAL<uint32>(L, 1); uint32 ev = Eluna::CHECKVAL<uint32>(L, 1);
luaL_checktype(L, 2, LUA_TFUNCTION); luaL_checktype(L, 2, LUA_TFUNCTION);
lua_pushvalue(L, 2); lua_pushvalue(L, 2);
int functionRef = lua_ref(L, true); int functionRef = luaL_ref(L, LUA_REGISTRYINDEX);
if (functionRef > 0) if (functionRef > 0)
sEluna->Register(HookMgr::REGTYPE_PLAYER, 0, ev, functionRef); sEluna->Register(HookMgr::REGTYPE_PLAYER, 0, ev, functionRef);
return 0; return 0;
@@ -318,7 +318,7 @@ namespace LuaGlobalFunctions
uint32 ev = Eluna::CHECKVAL<uint32>(L, 1); uint32 ev = Eluna::CHECKVAL<uint32>(L, 1);
luaL_checktype(L, 2, LUA_TFUNCTION); luaL_checktype(L, 2, LUA_TFUNCTION);
lua_pushvalue(L, 2); lua_pushvalue(L, 2);
int functionRef = lua_ref(L, true); int functionRef = luaL_ref(L, LUA_REGISTRYINDEX);
if (functionRef > 0) if (functionRef > 0)
sEluna->Register(HookMgr::REGTYPE_GUILD, 0, ev, functionRef); sEluna->Register(HookMgr::REGTYPE_GUILD, 0, ev, functionRef);
return 0; return 0;
@@ -329,7 +329,7 @@ namespace LuaGlobalFunctions
uint32 ev = Eluna::CHECKVAL<uint32>(L, 1); uint32 ev = Eluna::CHECKVAL<uint32>(L, 1);
luaL_checktype(L, 2, LUA_TFUNCTION); luaL_checktype(L, 2, LUA_TFUNCTION);
lua_pushvalue(L, 2); lua_pushvalue(L, 2);
int functionRef = lua_ref(L, true); int functionRef = luaL_ref(L, LUA_REGISTRYINDEX);
if (functionRef > 0) if (functionRef > 0)
sEluna->Register(HookMgr::REGTYPE_GROUP, 0, ev, functionRef); sEluna->Register(HookMgr::REGTYPE_GROUP, 0, ev, functionRef);
return 0; return 0;
@@ -341,7 +341,7 @@ namespace LuaGlobalFunctions
uint32 ev = Eluna::CHECKVAL<uint32>(L, 2); uint32 ev = Eluna::CHECKVAL<uint32>(L, 2);
luaL_checktype(L, 3, LUA_TFUNCTION); luaL_checktype(L, 3, LUA_TFUNCTION);
lua_pushvalue(L, 3); lua_pushvalue(L, 3);
int functionRef = lua_ref(L, true); int functionRef = luaL_ref(L, LUA_REGISTRYINDEX);
if (functionRef > 0) if (functionRef > 0)
sEluna->Register(HookMgr::REGTYPE_CREATURE_GOSSIP, entry, ev, functionRef); sEluna->Register(HookMgr::REGTYPE_CREATURE_GOSSIP, entry, ev, functionRef);
return 0; return 0;
@@ -353,7 +353,7 @@ namespace LuaGlobalFunctions
uint32 ev = Eluna::CHECKVAL<uint32>(L, 2); uint32 ev = Eluna::CHECKVAL<uint32>(L, 2);
luaL_checktype(L, 3, LUA_TFUNCTION); luaL_checktype(L, 3, LUA_TFUNCTION);
lua_pushvalue(L, 3); lua_pushvalue(L, 3);
int functionRef = lua_ref(L, true); int functionRef = luaL_ref(L, LUA_REGISTRYINDEX);
if (functionRef > 0) if (functionRef > 0)
sEluna->Register(HookMgr::REGTYPE_GAMEOBJECT_GOSSIP, entry, ev, functionRef); sEluna->Register(HookMgr::REGTYPE_GAMEOBJECT_GOSSIP, entry, ev, functionRef);
return 0; return 0;
@@ -365,7 +365,7 @@ namespace LuaGlobalFunctions
uint32 ev = Eluna::CHECKVAL<uint32>(L, 2); uint32 ev = Eluna::CHECKVAL<uint32>(L, 2);
luaL_checktype(L, 3, LUA_TFUNCTION); luaL_checktype(L, 3, LUA_TFUNCTION);
lua_pushvalue(L, 3); lua_pushvalue(L, 3);
int functionRef = lua_ref(L, true); int functionRef = luaL_ref(L, LUA_REGISTRYINDEX);
if (functionRef > 0) if (functionRef > 0)
sEluna->Register(HookMgr::REGTYPE_ITEM, entry, ev, functionRef); sEluna->Register(HookMgr::REGTYPE_ITEM, entry, ev, functionRef);
return 0; return 0;
@@ -377,7 +377,7 @@ namespace LuaGlobalFunctions
uint32 ev = Eluna::CHECKVAL<uint32>(L, 2); uint32 ev = Eluna::CHECKVAL<uint32>(L, 2);
luaL_checktype(L, 3, LUA_TFUNCTION); luaL_checktype(L, 3, LUA_TFUNCTION);
lua_pushvalue(L, 3); lua_pushvalue(L, 3);
int functionRef = lua_ref(L, true); int functionRef = luaL_ref(L, LUA_REGISTRYINDEX);
if (functionRef > 0) if (functionRef > 0)
sEluna->Register(HookMgr::REGTYPE_ITEM_GOSSIP, entry, ev, functionRef); sEluna->Register(HookMgr::REGTYPE_ITEM_GOSSIP, entry, ev, functionRef);
return 0; return 0;
@@ -389,7 +389,7 @@ namespace LuaGlobalFunctions
uint32 ev = Eluna::CHECKVAL<uint32>(L, 2); uint32 ev = Eluna::CHECKVAL<uint32>(L, 2);
luaL_checktype(L, 3, LUA_TFUNCTION); luaL_checktype(L, 3, LUA_TFUNCTION);
lua_pushvalue(L, 3); lua_pushvalue(L, 3);
int functionRef = lua_ref(L, true); int functionRef = luaL_ref(L, LUA_REGISTRYINDEX);
if (functionRef > 0) if (functionRef > 0)
sEluna->Register(HookMgr::REGTYPE_PLAYER_GOSSIP, menu_id, ev, functionRef); sEluna->Register(HookMgr::REGTYPE_PLAYER_GOSSIP, menu_id, ev, functionRef);
return 0; return 0;
@@ -401,7 +401,7 @@ namespace LuaGlobalFunctions
uint32 ev = Eluna::CHECKVAL<uint32>(L, 2); uint32 ev = Eluna::CHECKVAL<uint32>(L, 2);
luaL_checktype(L, 3, LUA_TFUNCTION); luaL_checktype(L, 3, LUA_TFUNCTION);
lua_pushvalue(L, 3); lua_pushvalue(L, 3);
int functionRef = lua_ref(L, true); int functionRef = luaL_ref(L, LUA_REGISTRYINDEX);
if (functionRef > 0) if (functionRef > 0)
sEluna->Register(HookMgr::REGTYPE_CREATURE, entry, ev, functionRef); sEluna->Register(HookMgr::REGTYPE_CREATURE, entry, ev, functionRef);
return 0; return 0;
@@ -413,7 +413,7 @@ namespace LuaGlobalFunctions
uint32 ev = Eluna::CHECKVAL<uint32>(L, 2); uint32 ev = Eluna::CHECKVAL<uint32>(L, 2);
luaL_checktype(L, 3, LUA_TFUNCTION); luaL_checktype(L, 3, LUA_TFUNCTION);
lua_pushvalue(L, 3); lua_pushvalue(L, 3);
int functionRef = lua_ref(L, true); int functionRef = luaL_ref(L, LUA_REGISTRYINDEX);
if (functionRef > 0) if (functionRef > 0)
sEluna->Register(HookMgr::REGTYPE_GAMEOBJECT, entry, ev, functionRef); sEluna->Register(HookMgr::REGTYPE_GAMEOBJECT, entry, ev, functionRef);
return 0; return 0;
@@ -517,7 +517,7 @@ namespace LuaGlobalFunctions
uint32 repeats = Eluna::CHECKVAL<uint32>(L, 3); uint32 repeats = Eluna::CHECKVAL<uint32>(L, 3);
lua_pushvalue(L, 1); 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); functionRef = sEluna->m_EventMgr->AddEvent(&sEluna->m_EventMgr->GlobalEvents, functionRef, delay, repeats);
if (functionRef) if (functionRef)
Eluna::Push(L, functionRef); Eluna::Push(L, functionRef);

View File

@@ -1568,7 +1568,7 @@ namespace LuaUnit
uint32 repeats = Eluna::CHECKVAL<uint32>(L, 4); uint32 repeats = Eluna::CHECKVAL<uint32>(L, 4);
lua_pushvalue(L, 2); 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); functionRef = sEluna->m_EventMgr->AddEvent(&unit->m_Events, functionRef, delay, repeats, unit);
if (functionRef) if (functionRef)
Eluna::Push(L, functionRef); Eluna::Push(L, functionRef);