diff options
author | Treeston <treeston.mmoc@gmail.com> | 2019-06-23 17:18:42 +0200 |
---|---|---|
committer | Treeston <treeston.mmoc@gmail.com> | 2019-06-23 17:18:42 +0200 |
commit | 8499434340919902b5aefe58f812c3f24d37310d (patch) | |
tree | f926cf5149eeb7cbf476a3511358703176822057 /src/server/game/AI/CreatureAI.cpp | |
parent | aeed616c22868e2c5759c01d2c0feb52a7c3bc97 (diff) |
Core/AI: Remove EnterEvadeMode calls from Guardian/Summon spell handlers. Add follow logic to CreatureAI::JustAppeared. Closes #23270.
Diffstat (limited to 'src/server/game/AI/CreatureAI.cpp')
-rw-r--r-- | src/server/game/AI/CreatureAI.cpp | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/src/server/game/AI/CreatureAI.cpp b/src/server/game/AI/CreatureAI.cpp index 1a468a4e8a1..a7d2888fc0b 100644 --- a/src/server/game/AI/CreatureAI.cpp +++ b/src/server/game/AI/CreatureAI.cpp @@ -151,6 +151,18 @@ void CreatureAI::TriggerAlert(Unit const* who) const me->GetMotionMaster()->MoveDistract(5 * IN_MILLISECONDS, me->GetAbsoluteAngle(who)); } +void CreatureAI::JustAppeared() +{ + if (!me->GetVehicle()) + { + if (Unit* owner = me->GetCharmerOrOwner()) + { + me->GetMotionMaster()->Clear(); + me->GetMotionMaster()->MoveFollow(owner, PET_FOLLOW_DIST, me->GetFollowAngle()); + } + } +} + void CreatureAI::EnterEvadeMode(EvadeReason why) { if (!_EnterEvadeMode(why)) |