aboutsummaryrefslogtreecommitdiff
path: root/src/server/game/AI/CreatureAI.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/server/game/AI/CreatureAI.cpp')
-rw-r--r--src/server/game/AI/CreatureAI.cpp15
1 files changed, 9 insertions, 6 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());
+ }
}
}
}