Permalink
Browse files

Fix cmangos (classic) build

  • Loading branch information...
1 parent 4aba0d6 commit 67ea403f1028e53623df768dcd29db3688a326b7 @Rochet2 Rochet2 committed Nov 27, 2016
Showing with 78 additions and 8 deletions.
  1. +7 −3 CreatureMethods.h
  2. +4 −0 ElunaIncludes.h
  3. +4 −0 GroupMethods.h
  4. +8 −0 GuildMethods.h
  5. +4 −0 ItemHooks.cpp
  6. +1 −5 LuaEngine.h
  7. +27 −0 PlayerMethods.h
  8. +12 −0 UnitMethods.h
  9. +11 −0 WorldObjectMethods.h
View
@@ -121,10 +121,10 @@ namespace LuaCreature
{
Player* player = Eluna::CHECKOBJ<Player>(L, 2);
-#ifdef MANGOS
- Eluna::Push(L, creature->IsTappedBy(player));
-#else
+#ifdef TRINITY
Eluna::Push(L, creature->isTappedBy(player));
+#else
+ Eluna::Push(L, creature->IsTappedBy(player));
#endif
return 1;
}
@@ -1102,8 +1102,12 @@ namespace LuaCreature
data.Initialize(SMSG_MOVE_UNSET_HOVER, 8 + 4);
data << creature->GetPackGUID();
data << uint32(0);
+#ifdef CMANGOS
+ creature->SendMessageToSet(data, true);
+#else
creature->SendMessageToSet(&data, true);
#endif
+#endif
return 0;
}
View
@@ -49,7 +49,11 @@
#include "SpellHistory.h"
#else
#include "Config/Config.h"
+#ifdef CMANGOS
+#include "AI/AggressorAI.h"
+#else
#include "AggressorAI.h"
+#endif
#include "BattleGroundMgr.h"
#include "SQLStorages.h"
#include "revision.h"
View
@@ -291,7 +291,11 @@ namespace LuaGroup
bool ignorePlayersInBg = Eluna::CHECKVAL<bool>(L, 3);
uint64 ignore = Eluna::CHECKVAL<uint64>(L, 4);
+#ifdef CMANGOS
+ group->BroadcastPacket(*data, ignorePlayersInBg, -1, ObjectGuid(ignore));
+#else
group->BroadcastPacket(data, ignorePlayersInBg, -1, ObjectGuid(ignore));
+#endif
return 0;
}
View
@@ -195,7 +195,11 @@ namespace LuaGuild
{
WorldPacket* data = Eluna::CHECKOBJ<WorldPacket>(L, 2);
+#ifdef CMANGOS
+ guild->BroadcastPacket(*data);
+#else
guild->BroadcastPacket(data);
+#endif
return 0;
}
@@ -211,7 +215,11 @@ namespace LuaGuild
WorldPacket* data = Eluna::CHECKOBJ<WorldPacket>(L, 2);
uint8 ranked = Eluna::CHECKVAL<uint8>(L, 3);
+#ifdef CMANGOS
+ guild->BroadcastPacketToRank(*data, ranked);
+#else
guild->BroadcastPacketToRank(data, ranked);
+#endif
return 0;
}
View
@@ -66,7 +66,11 @@ bool Eluna::OnUse(Player* pPlayer, Item* pItem, SpellCastTargets const& targets)
data << ObjectGuid(guid);
data << ObjectGuid(uint64(0));
data << uint8(0);
+#ifdef CMANGOS
+ pPlayer->GetSession()->SendPacket(data);
+#else
pPlayer->GetSession()->SendPacket(&data);
+#endif
return false;
}
View
@@ -123,13 +123,9 @@ class TC_GAME_API Eluna
{
public:
typedef std::list<LuaScript> ScriptList;
-#ifdef TRINITY
+
typedef std::recursive_mutex LockType;
typedef std::lock_guard<LockType> Guard;
-#else
- typedef ACE_Recursive_Thread_Mutex LockType;
- typedef ACE_Guard<LockType> Guard;
-#endif
private:
static bool reload;
View
@@ -2155,8 +2155,12 @@ namespace LuaPlayer
data << uint64(summoner->GetGUIDLow());
data << uint32(summoner->GetZoneId());
data << uint32(MAX_PLAYER_SUMMON_DELAY * IN_MILLISECONDS);
+#ifdef CMANGOS
+ player->GetSession()->SendPacket(data);
+#else
player->GetSession()->SendPacket(&data);
#endif
+#endif
return 0;
}
@@ -2231,7 +2235,11 @@ namespace LuaPlayer
#endif
data << uint32(ahEntry->houseId);
data << uint8(1);
+#ifdef CMANGOS
+ player->GetSession()->SendPacket(data);
+#else
player->GetSession()->SendPacket(&data);
+#endif
return 0;
}
@@ -3492,10 +3500,17 @@ namespace LuaPlayer
{
WorldPacket* data = Eluna::CHECKOBJ<WorldPacket>(L, 2);
bool selfOnly = Eluna::CHECKVAL<bool>(L, 3, true);
+#ifdef CMANGOS
+ if (selfOnly)
+ player->GetSession()->SendPacket(*data);
+ else
+ player->SendMessageToSet(*data, true);
+#else
if (selfOnly)
player->GetSession()->SendPacket(data);
else
player->SendMessageToSet(data, true);
+#endif
return 0;
}
@@ -3529,7 +3544,11 @@ namespace LuaPlayer
data << uint32(fullmsg.length() + 1);
data << fullmsg;
data << uint8(0);
+#ifdef CMANGOS
+ receiver->GetSession()->SendPacket(data);
+#else
receiver->GetSession()->SendPacket(&data);
+#endif
return 0;
}
@@ -3736,7 +3755,11 @@ namespace LuaPlayer
packet << icon;
packet << data;
packet << iconText;
+#ifdef CMANGOS
+ player->GetSession()->SendPacket(packet);
+#else
player->GetSession()->SendPacket(&packet);
+#endif
return 0;
}
@@ -3842,7 +3865,11 @@ namespace LuaPlayer
#if defined(CLASSIC) || defined(TBC)
WorldPacket data(SMSG_GROUP_INVITE, 10); // guess size
data << player->GetName();
+#ifdef CMANGOS
+ invited->GetSession()->SendPacket(data);
+#else
invited->GetSession()->SendPacket(&data);
+#endif
#else
WorldPacket data(SMSG_GROUP_INVITE, 10); // guess size
data << uint8(1); // invited/already in group flag
View
@@ -1998,7 +1998,11 @@ namespace LuaUnit
#else
ChatHandler::BuildChatPacket(data, ChatMsg(type), msg.c_str(), Language(lang), 0, unit->GET_GUID(), unit->GetName(), target->GET_GUID(), target->GetName());
#endif
+#ifdef CMANGOS
+ target->GetSession()->SendPacket(data);
+#else
target->GetSession()->SendPacket(&data);
+#endif
return 0;
}
@@ -2286,7 +2290,11 @@ namespace LuaUnit
if (!spellEntry)
return 0;
+#ifdef CMANGOS
+ unit->CastSpell(target, spell, TRIGGERED_OLD_TRIGGERED);
+#else
unit->CastSpell(target, spell, triggered);
+#endif
return 0;
}
@@ -2337,7 +2345,11 @@ namespace LuaUnit
float _z = Eluna::CHECKVAL<float>(L, 4);
uint32 spell = Eluna::CHECKVAL<uint32>(L, 5);
bool triggered = Eluna::CHECKVAL<bool>(L, 6, true);
+#ifdef CMANGOS
+ unit->CastSpell(_x, _y, _z, spell, TRIGGERED_OLD_TRIGGERED);
+#else
unit->CastSpell(_x, _y, _z, spell, triggered);
+#endif
return 0;
}
View
@@ -656,7 +656,11 @@ namespace LuaWorldObject
int SendPacket(Eluna* /*E*/, lua_State* L, WorldObject* obj)
{
WorldPacket* data = Eluna::CHECKOBJ<WorldPacket>(L, 2);
+#ifdef CMANGOS
+ obj->SendMessageToSet(*data, true);
+#else
obj->SendMessageToSet(data, true);
+#endif
return 0;
}
@@ -868,10 +872,17 @@ namespace LuaWorldObject
WorldPacket data(SMSG_PLAY_MUSIC, 4);
data << uint32(musicid);
+#ifdef CMANGOS
+ if (player)
+ player->SendDirectMessage(data);
+ else
+ obj->SendMessageToSet(data, true);
+#else
if (player)
player->SendDirectMessage(&data);
else
obj->SendMessageToSet(&data, true);
+#endif
return 0;
}

0 comments on commit 67ea403

Please sign in to comment.