diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/server/game/AI/CreatureAI.cpp | 15 | ||||
-rw-r--r-- | src/server/game/Combat/ThreatManager.cpp | 9 |
2 files changed, 15 insertions, 9 deletions
diff --git a/src/server/game/AI/CreatureAI.cpp b/src/server/game/AI/CreatureAI.cpp index 7d617a9c384..5052033971f 100644 --- a/src/server/game/AI/CreatureAI.cpp +++ b/src/server/game/AI/CreatureAI.cpp @@ -193,15 +193,18 @@ static bool ShouldFollowOnSpawn(SummonPropertiesEntry const* properties) void CreatureAI::JustAppeared() { - if (TempSummon* summon = me->ToTempSummon()) + if (!IsEngaged()) { - // Only apply this to specific types of summons - if (!summon->GetVehicle() && ShouldFollowOnSpawn(summon->m_Properties)) + if (TempSummon* summon = me->ToTempSummon()) { - if (Unit* owner = summon->GetCharmerOrOwner()) + // Only apply this to specific types of summons + if (!summon->GetVehicle() && ShouldFollowOnSpawn(summon->m_Properties)) { - summon->GetMotionMaster()->Clear(); - summon->GetMotionMaster()->MoveFollow(owner, PET_FOLLOW_DIST, summon->GetFollowAngle()); + if (Unit* owner = summon->GetCharmerOrOwner()) + { + summon->GetMotionMaster()->Clear(); + summon->GetMotionMaster()->MoveFollow(owner, PET_FOLLOW_DIST, summon->GetFollowAngle()); + } } } } diff --git a/src/server/game/Combat/ThreatManager.cpp b/src/server/game/Combat/ThreatManager.cpp index 6ad8de0aabb..41f96d2d7c8 100644 --- a/src/server/game/Combat/ThreatManager.cpp +++ b/src/server/game/Combat/ThreatManager.cpp @@ -25,6 +25,7 @@ #include "Player.h" #include "SpellAuraEffects.h" #include "SpellMgr.h" +#include "TemporarySummon.h" #include "Hacks/boost_1_74_fibonacci_heap.h" BOOST_1_74_FIBONACCI_HEAP_MSVC_COMPILE_FIX(ThreatManager::threat_list_heap::value_type) @@ -158,9 +159,11 @@ void ThreatReference::UnregisterAndFree() if (cWho->IsPet() || cWho->IsTotem() || cWho->IsTrigger()) return false; - // summons cannot have a threat list, unless they are controlled by a creature - if (cWho->HasUnitTypeMask(UNIT_MASK_MINION | UNIT_MASK_GUARDIAN) && !cWho->GetOwnerGUID().IsCreature()) - return false; + // summons cannot have a threat list if they were summoned by a player + if (cWho->HasUnitTypeMask(UNIT_MASK_MINION | UNIT_MASK_GUARDIAN)) + if (TempSummon const* tWho = cWho->ToTempSummon()) + if (tWho->GetSummonerGUID().IsPlayer()) + return false; return true; } |