diff options
author | ccrs <ccrs@users.noreply.github.com> | 2018-06-03 10:06:57 -0700 |
---|---|---|
committer | Shauren <shauren.trinity@gmail.com> | 2021-09-28 00:15:13 +0200 |
commit | 426f9f2f92b26fbb68e7cda9290ccbd586c6af4e (patch) | |
tree | ede70b7865c2edb58964c7aa668eb1250a5816ab /src/server/game/AI/CreatureAI.cpp | |
parent | 3e0af19b7767d6e71a7467874fdad566cea5ee87 (diff) |
Core/Movement: MotionMaster reimplementation (#21888)
Internal structure and handling changes, nothing behavioural (or thats the intention at least).
(cherry picked from commit 982643cd96790ffc54e7a3e507469649f3b074d2)
Diffstat (limited to 'src/server/game/AI/CreatureAI.cpp')
-rw-r--r-- | src/server/game/AI/CreatureAI.cpp | 8 |
1 files changed, 3 insertions, 5 deletions
diff --git a/src/server/game/AI/CreatureAI.cpp b/src/server/game/AI/CreatureAI.cpp index e41d104c380..4e8e035bf5b 100644 --- a/src/server/game/AI/CreatureAI.cpp +++ b/src/server/game/AI/CreatureAI.cpp @@ -160,9 +160,7 @@ void CreatureAI::TriggerAlert(Unit const* who) const me->SendAIReaction(AI_REACTION_ALERT); // Face the unit (stealthed player) and set distracted state for 5 seconds - me->GetMotionMaster()->MoveDistract(5 * IN_MILLISECONDS); - me->StopMoving(); - me->SetFacingTo(me->GetAbsoluteAngle(who)); + me->GetMotionMaster()->MoveDistract(5 * IN_MILLISECONDS, me->GetAbsoluteAngle(who)); } void CreatureAI::EnterEvadeMode(EvadeReason why) @@ -176,8 +174,8 @@ void CreatureAI::EnterEvadeMode(EvadeReason why) { if (Unit* owner = me->GetCharmerOrOwner()) { - me->GetMotionMaster()->Clear(false); - me->GetMotionMaster()->MoveFollow(owner, PET_FOLLOW_DIST, me->GetFollowAngle(), MOTION_SLOT_ACTIVE); + me->GetMotionMaster()->Clear(); + me->GetMotionMaster()->MoveFollow(owner, PET_FOLLOW_DIST, me->GetFollowAngle()); } else { |