diff options
author | Shauren <shauren.trinity@gmail.com> | 2021-12-19 18:12:12 +0100 |
---|---|---|
committer | Shauren <shauren.trinity@gmail.com> | 2021-12-19 18:12:12 +0100 |
commit | 68a25f5e9bdd48330e48133961ca22183130e424 (patch) | |
tree | 856814e53d7cd18b6e7a737d997ee35371a623ee /src | |
parent | d7571e5d1f3b4cd5672a6344d96c782d7c83ea88 (diff) |
Core/Scripts: Add missing implementation for samePhase argument of ScriptedAI::ForceCombatStopForCreatureEntry
Diffstat (limited to 'src')
-rw-r--r-- | src/server/game/AI/ScriptedAI/ScriptedCreature.cpp | 14 |
1 files changed, 9 insertions, 5 deletions
diff --git a/src/server/game/AI/ScriptedAI/ScriptedCreature.cpp b/src/server/game/AI/ScriptedAI/ScriptedCreature.cpp index 5bc89845941..7c12e931d23 100644 --- a/src/server/game/AI/ScriptedAI/ScriptedCreature.cpp +++ b/src/server/game/AI/ScriptedAI/ScriptedCreature.cpp @@ -27,6 +27,7 @@ #include "Log.h" #include "MotionMaster.h" #include "ObjectAccessor.h" +#include "PhasingHandler.h" #include "Spell.h" #include "SpellMgr.h" #include "TemporarySummon.h" @@ -245,7 +246,8 @@ void ScriptedAI::ForceCombatStop(Creature* who, bool reset /*= true*/) who->DoNotReacquireSpellFocusTarget(); who->GetMotionMaster()->Clear(MOTION_PRIORITY_NORMAL); - if (reset) { + if (reset) + { who->LoadCreaturesAddon(); who->SetLootRecipient(nullptr); who->ResetPlayerDamageReq(); @@ -254,7 +256,7 @@ void ScriptedAI::ForceCombatStop(Creature* who, bool reset /*= true*/) } } -void ScriptedAI::ForceCombatStopForCreatureEntry(uint32 entry, float maxSearchRange /*= 250.0f*/, bool /*samePhase*/ /*= true*/, bool reset /*= true*/) +void ScriptedAI::ForceCombatStopForCreatureEntry(uint32 entry, float maxSearchRange /*= 250.0f*/, bool samePhase /*= true*/, bool reset /*= true*/) { TC_LOG_DEBUG("scripts.ai", "ScriptedAI::ForceCombatStopForCreatureEntry: called on '%s'. Debug info: %s", me->GetGUID().ToString().c_str(), me->GetDebugInfo().c_str()); @@ -262,12 +264,14 @@ void ScriptedAI::ForceCombatStopForCreatureEntry(uint32 entry, float maxSearchRa Trinity::AllCreaturesOfEntryInRange check(me, entry, maxSearchRange); Trinity::CreatureListSearcher<Trinity::AllCreaturesOfEntryInRange> searcher(me, creatures, check); - // TODO: FIX THIS - //if (!samePhase) - // searcher.i_phaseMask = PHASEMASK_ANYWHERE; + if (!samePhase) + PhasingHandler::SetAlwaysVisible(me, true, false); Cell::VisitGridObjects(me, searcher, maxSearchRange); + if (!samePhase) + PhasingHandler::SetAlwaysVisible(me, false, false); + for (Creature* creature : creatures) ForceCombatStop(creature, reset); } |