From 8acf303652f5809b42b4cbb40517e306a7298429 Mon Sep 17 00:00:00 2001 From: Rochet2 Date: Wed, 4 Jun 2014 20:47:33 +0300 Subject: [PATCH] Eluna fix build --- GlobalMethods.h | 24 ++++++++++++------------ HookMgr.cpp | 2 +- LuaEngine.h | 6 +++--- 3 files changed, 16 insertions(+), 16 deletions(-) diff --git a/GlobalMethods.h b/GlobalMethods.h index b32b691..548408f 100644 --- a/GlobalMethods.h +++ b/GlobalMethods.h @@ -287,7 +287,7 @@ namespace LuaGlobalFunctions lua_pushvalue(L, 2); int functionRef = lua_ref(L, true); if (functionRef > 0) - sEluna->Register(REGTYPE_PACKET, entry, ev, functionRef); + sEluna->Register(HookMgr::REGTYPE_PACKET, entry, ev, functionRef); return 0; } @@ -298,7 +298,7 @@ namespace LuaGlobalFunctions lua_pushvalue(L, 2); int functionRef = lua_ref(L, true); if (functionRef > 0) - sEluna->Register(REGTYPE_SERVER, 0, ev, functionRef); + sEluna->Register(HookMgr::REGTYPE_SERVER, 0, ev, functionRef); return 0; } @@ -309,7 +309,7 @@ namespace LuaGlobalFunctions lua_pushvalue(L, 2); int functionRef = lua_ref(L, true); if (functionRef > 0) - sEluna->Register(REGTYPE_PLAYER, 0, ev, functionRef); + sEluna->Register(HookMgr::REGTYPE_PLAYER, 0, ev, functionRef); return 0; } @@ -320,7 +320,7 @@ namespace LuaGlobalFunctions lua_pushvalue(L, 2); int functionRef = lua_ref(L, true); if (functionRef > 0) - sEluna->Register(REGTYPE_GUILD, 0, ev, functionRef); + sEluna->Register(HookMgr::REGTYPE_GUILD, 0, ev, functionRef); return 0; } @@ -331,7 +331,7 @@ namespace LuaGlobalFunctions lua_pushvalue(L, 2); int functionRef = lua_ref(L, true); if (functionRef > 0) - sEluna->Register(REGTYPE_GROUP, 0, ev, functionRef); + sEluna->Register(HookMgr::REGTYPE_GROUP, 0, ev, functionRef); return 0; } @@ -343,7 +343,7 @@ namespace LuaGlobalFunctions lua_pushvalue(L, 3); int functionRef = lua_ref(L, true); if (functionRef > 0) - sEluna->Register(REGTYPE_CREATURE_GOSSIP, entry, ev, functionRef); + sEluna->Register(HookMgr::REGTYPE_CREATURE_GOSSIP, entry, ev, functionRef); return 0; } @@ -355,7 +355,7 @@ namespace LuaGlobalFunctions lua_pushvalue(L, 3); int functionRef = lua_ref(L, true); if (functionRef > 0) - sEluna->Register(REGTYPE_GAMEOBJECT_GOSSIP, entry, ev, functionRef); + sEluna->Register(HookMgr::REGTYPE_GAMEOBJECT_GOSSIP, entry, ev, functionRef); return 0; } @@ -367,7 +367,7 @@ namespace LuaGlobalFunctions lua_pushvalue(L, 3); int functionRef = lua_ref(L, true); if (functionRef > 0) - sEluna->Register(REGTYPE_ITEM, entry, ev, functionRef); + sEluna->Register(HookMgr::REGTYPE_ITEM, entry, ev, functionRef); return 0; } @@ -379,7 +379,7 @@ namespace LuaGlobalFunctions lua_pushvalue(L, 3); int functionRef = lua_ref(L, true); if (functionRef > 0) - sEluna->Register(REGTYPE_ITEM_GOSSIP, entry, ev, functionRef); + sEluna->Register(HookMgr::REGTYPE_ITEM_GOSSIP, entry, ev, functionRef); return 0; } @@ -391,7 +391,7 @@ namespace LuaGlobalFunctions lua_pushvalue(L, 3); int functionRef = lua_ref(L, true); if (functionRef > 0) - sEluna->Register(REGTYPE_PLAYER_GOSSIP, menu_id, ev, functionRef); + sEluna->Register(HookMgr::REGTYPE_PLAYER_GOSSIP, menu_id, ev, functionRef); return 0; } @@ -403,7 +403,7 @@ namespace LuaGlobalFunctions lua_pushvalue(L, 3); int functionRef = lua_ref(L, true); if (functionRef > 0) - sEluna->Register(REGTYPE_CREATURE, entry, ev, functionRef); + sEluna->Register(HookMgr::REGTYPE_CREATURE, entry, ev, functionRef); return 0; } @@ -415,7 +415,7 @@ namespace LuaGlobalFunctions lua_pushvalue(L, 3); int functionRef = lua_ref(L, true); if (functionRef > 0) - sEluna->Register(REGTYPE_GAMEOBJECT, entry, ev, functionRef); + sEluna->Register(HookMgr::REGTYPE_GAMEOBJECT, entry, ev, functionRef); return 0; } diff --git a/HookMgr.cpp b/HookMgr.cpp index 5e3f35d..c16b520 100644 --- a/HookMgr.cpp +++ b/HookMgr.cpp @@ -32,7 +32,7 @@ ENDCALL(); lua_State* L = sEluna->L; \ uint32 _LuaEvent = EVENT; \ int _LuaStackTop = lua_gettop(L); \ - for (int i = 0; i < sEluna->BINDMAP->Bindings[EVENT].size(); ++i) \ + for (size_t i = 0; i < sEluna->BINDMAP->Bindings[EVENT].size(); ++i) \ lua_rawgeti(L, LUA_REGISTRYINDEX, (sEluna->BINDMAP->Bindings[EVENT][i])); \ int _LuaFuncTop = lua_gettop(L); \ Eluna::Push(L, _LuaEvent); diff --git a/LuaEngine.h b/LuaEngine.h index bd49037..6cd5290 100644 --- a/LuaEngine.h +++ b/LuaEngine.h @@ -366,7 +366,7 @@ struct EventBind void Insert(int eventId, int funcRef) // Inserts a new registered event { - Bindings[eventId].push_back(funcRef); + Bindings[(T)eventId].push_back(funcRef); } // Gets the binding std::map containing all registered events with the function refs for the entry @@ -424,13 +424,13 @@ struct EntryBind void Insert(uint32 entryId, int eventId, int funcRef) // Inserts a new registered event { - if (Bindings[entryId][eventId]) + if (Bindings[entryId][(T)eventId]) { luaL_unref(E.L, LUA_REGISTRYINDEX, funcRef); // free the unused ref luaL_error(E.L, "A function is already registered for entry (%d) event (%d)", entryId, eventId); } else - Bindings[entryId][eventId] = funcRef; + Bindings[entryId][(T)eventId] = funcRef; } // Gets the function ref of an entry for an event