aboutsummaryrefslogtreecommitdiff
path: root/src/server/game/AI/SmartScripts
diff options
context:
space:
mode:
authorGiacomo Pozzoni <giacomopoz@gmail.com>2020-03-01 13:31:14 +0100
committerGitHub <noreply@github.com>2020-03-01 13:31:13 +0100
commitddf2f60c1317f0ce728d5894064f51251cf71c72 (patch)
treed19bc0b22bed69fcb156179276359959c2be1739 /src/server/game/AI/SmartScripts
parent94186a5e79d5d3fe29ac80245992af6365999a93 (diff)
Core/AI: Make charmed creatures follow their owner (#24195)
* Core/AI: Make charmed creatures follow their owner * Follow the charmer only when applying the charm * Make SmartAI follow the charmer
Diffstat (limited to 'src/server/game/AI/SmartScripts')
-rw-r--r--src/server/game/AI/SmartScripts/SmartAI.cpp3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/server/game/AI/SmartScripts/SmartAI.cpp b/src/server/game/AI/SmartScripts/SmartAI.cpp
index 90236d81a8f..4bc9aeafe0c 100644
--- a/src/server/game/AI/SmartScripts/SmartAI.cpp
+++ b/src/server/game/AI/SmartScripts/SmartAI.cpp
@@ -690,6 +690,9 @@ void SmartAI::OnCharmed(bool /*isNew*/)
_charmed = charmed;
+ if (charmed)
+ me->GetMotionMaster()->MoveFollow(me->GetCharmer(), PET_FOLLOW_DIST, me->GetFollowAngle());
+
if (!charmed && !me->IsInEvadeMode())
{
if (_repeatWaypointPath)