From 31f4cfd98c6c22ac14d3cb5a642382a3a23d4df8 Mon Sep 17 00:00:00 2001 From: Rochet2 Date: Mon, 29 Jun 2020 13:58:03 +0300 Subject: [PATCH] Fix TC build --- CreatureHooks.cpp | 4 ++-- ElunaCreatureAI.h | 8 ++++++++ LuaEngine.h | 4 ++-- MapMethods.h | 6 +++++- 4 files changed, 17 insertions(+), 5 deletions(-) diff --git a/CreatureHooks.cpp b/CreatureHooks.cpp index 1d7afcf..e2bd6d1 100644 --- a/CreatureHooks.cpp +++ b/CreatureHooks.cpp @@ -282,7 +282,7 @@ void Eluna::On_Reset(Creature* me) // Not an override, custom } // Called when hit by a spell -bool Eluna::SpellHit(Creature* me, Unit* caster, SpellInfo const* spell) +bool Eluna::SpellHit(Creature* me, WorldObject* caster, SpellInfo const* spell) { START_HOOK_WITH_RETVAL(CREATURE_EVENT_ON_HIT_BY_SPELL, me, false); Push(me); @@ -292,7 +292,7 @@ bool Eluna::SpellHit(Creature* me, Unit* caster, SpellInfo const* spell) } // Called when spell hits a target -bool Eluna::SpellHitTarget(Creature* me, Unit* target, SpellInfo const* spell) +bool Eluna::SpellHitTarget(Creature* me, WorldObject* target, SpellInfo const* spell) { START_HOOK_WITH_RETVAL(CREATURE_EVENT_ON_SPELL_HIT_TARGET, me, false); Push(me); diff --git a/ElunaCreatureAI.h b/ElunaCreatureAI.h index 53434fc..05ceed1 100644 --- a/ElunaCreatureAI.h +++ b/ElunaCreatureAI.h @@ -216,14 +216,22 @@ struct ElunaCreatureAI : ScriptedAI } // Called when hit by a spell +#if defined TRINITY + void SpellHit(WorldObject* caster, SpellInfo const* spell) override +#else void SpellHit(Unit* caster, SpellInfo const* spell) override +#endif { if (!sEluna->SpellHit(me, caster, spell)) ScriptedAI::SpellHit(caster, spell); } // Called when spell hits a target +#if defined TRINITY + void SpellHitTarget(WorldObject* target, SpellInfo const* spell) override +#else void SpellHitTarget(Unit* target, SpellInfo const* spell) override +#endif { if (!sEluna->SpellHitTarget(me, target, spell)) ScriptedAI::SpellHitTarget(target, spell); diff --git a/LuaEngine.h b/LuaEngine.h index f96953d..bc64940 100644 --- a/LuaEngine.h +++ b/LuaEngine.h @@ -393,8 +393,8 @@ public: bool ReceiveEmote(Creature* me, Player* player, uint32 emoteId); bool CorpseRemoved(Creature* me, uint32& respawnDelay); bool MoveInLineOfSight(Creature* me, Unit* who); - bool SpellHit(Creature* me, Unit* caster, SpellInfo const* spell); - bool SpellHitTarget(Creature* me, Unit* target, SpellInfo const* spell); + bool SpellHit(Creature* me, WorldObject* caster, SpellInfo const* spell); + bool SpellHitTarget(Creature* me, WorldObject* target, SpellInfo const* spell); bool SummonedCreatureDies(Creature* me, Creature* summon, Unit* killer); bool OwnerAttackedBy(Creature* me, Unit* attacker); bool OwnerAttacked(Creature* me, Unit* target); diff --git a/MapMethods.h b/MapMethods.h index a9a7799..d1513e6 100644 --- a/MapMethods.h +++ b/MapMethods.h @@ -182,6 +182,7 @@ namespace LuaMap * @param float x * @param float y * @param float z + * @param uint32 phasemask = PHASEMASK_NORMAL * @return uint32 areaId */ int GetAreaId(lua_State* L, Map* map) @@ -189,8 +190,11 @@ namespace LuaMap float x = Eluna::CHECKVAL(L, 2); float y = Eluna::CHECKVAL(L, 3); float z = Eluna::CHECKVAL(L, 4); +#if defined TRINITY + float phasemask = Eluna::CHECKVAL(L, 5, PHASEMASK_NORMAL); -#if defined TRINITY || AZEROTHCORE + Eluna::Push(L, map->GetAreaId(phasemask, x, y, z)); +#elif defined AZEROTHCORE Eluna::Push(L, map->GetAreaId(x, y, z)); #else Eluna::Push(L, map->GetTerrain()->GetAreaId(x, y, z));