From 40774d0c5cf4d8532a74f229890556175f363e9d Mon Sep 17 00:00:00 2001 From: Rochet2 Date: Mon, 2 Jun 2014 15:49:42 +0300 Subject: [PATCH] Eluna fix opcode definitions --- GlobalMethods.h | 2 +- HookMgr.cpp | 4 ++-- LuaEngine.h | 7 +++---- WorldPacketMethods.h | 2 +- 4 files changed, 7 insertions(+), 8 deletions(-) diff --git a/GlobalMethods.h b/GlobalMethods.h index 418fd86..b32b691 100644 --- a/GlobalMethods.h +++ b/GlobalMethods.h @@ -831,7 +831,7 @@ namespace LuaGlobalFunctions if (opcode >= NUM_MSG_TYPES) return luaL_argerror(L, 1, "valid opcode expected"); - Eluna::Push(L, new WorldPacket((Opcodes)opcode, size)); + Eluna::Push(L, new WorldPacket((OpcodesList)opcode, size)); return 1; } diff --git a/HookMgr.cpp b/HookMgr.cpp index 33f22f2..36ee658 100644 --- a/HookMgr.cpp +++ b/HookMgr.cpp @@ -173,7 +173,7 @@ void Eluna::OnPacketSendAny(Player* player, WorldPacket& packet, bool& result) } void Eluna::OnPacketSendOne(Player* player, WorldPacket& packet, bool& result) { - ENTRY_BEGIN(PacketEventBindings, Opcodes(packet.GetOpcode()), SERVER_EVENT_ON_PACKET_SEND, return); + ENTRY_BEGIN(PacketEventBindings, OpcodesList(packet.GetOpcode()), SERVER_EVENT_ON_PACKET_SEND, return); Push(L, new WorldPacket(packet)); Push(L, player); ENTRY_EXECUTE(2); @@ -224,7 +224,7 @@ void Eluna::OnPacketReceiveAny(Player* player, WorldPacket& packet, bool& result } void Eluna::OnPacketReceiveOne(Player* player, WorldPacket& packet, bool& result) { - ENTRY_BEGIN(PacketEventBindings, Opcodes(packet.GetOpcode()), SERVER_EVENT_ON_PACKET_RECEIVE, return); + ENTRY_BEGIN(PacketEventBindings, OpcodesList(packet.GetOpcode()), SERVER_EVENT_ON_PACKET_RECEIVE, return); Push(L, new WorldPacket(packet)); Push(L, player); ENTRY_EXECUTE(2); diff --git a/LuaEngine.h b/LuaEngine.h index d7110c0..0b3bd0f 100644 --- a/LuaEngine.h +++ b/LuaEngine.h @@ -121,10 +121,6 @@ enum SelectAggroTarget #ifdef TBC #define SPELL_AURA_MOD_KILL_XP_PCT SPELL_AURA_MOD_XP_PCT #endif -#ifdef CLASSIC -#undef Opcodes -#define Opcodes OpcodesList -#endif #else #define eWorld (sWorld) #define eMapMgr (sMapMgr) @@ -148,6 +144,9 @@ typedef ThreatContainer::StorageType ThreatList; #define NUM_MSG_TYPES NUM_OPCODE_HANDLERS #endif #endif +#ifndef CLASSIC +typedef OpcodesList Opcodes +#endif class Eluna; diff --git a/WorldPacketMethods.h b/WorldPacketMethods.h index 38d20ef..410cabf 100644 --- a/WorldPacketMethods.h +++ b/WorldPacketMethods.h @@ -29,7 +29,7 @@ namespace LuaPacket uint32 opcode = Eluna::CHECKVAL(L, 2); if (opcode >= NUM_MSG_TYPES) return luaL_argerror(L, 2, "valid opcode expected"); - packet->SetOpcode((Opcodes)opcode); + packet->SetOpcode((OpcodesList)opcode); return 0; }