diff options
author | Treeston <treeston.mmoc@gmail.com> | 2019-07-21 03:59:17 +0200 |
---|---|---|
committer | Shauren <shauren.trinity@gmail.com> | 2021-12-17 00:25:59 +0100 |
commit | a4c2c0fb1d1b9fae832ecc52aa68fe3fb8d1ca52 (patch) | |
tree | cece7a43e2e8a8a5a8d066669bbfd47c6b8c2486 /src/server/game/AI/CreatureAI.cpp | |
parent | a2b1b3e2aad4f2ecfbf156d96890c1ecde678c11 (diff) |
Core/AI: No longer override chase movement with follow movement if the creature engages before JustAppeared has had a chance to fire.
(cherry picked from commit 49b04c0fdd03d060d10f91a597857ec9c3d9f4ed)
Diffstat (limited to 'src/server/game/AI/CreatureAI.cpp')
-rw-r--r-- | src/server/game/AI/CreatureAI.cpp | 15 |
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()); + } } } } |