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
committerShauren <shauren.trinity@gmail.com>2021-12-22 20:46:17 +0100
commit144cfc2bcebbd0d2bbce5f97a06f634d17d62e79 (patch)
tree08db9b4bb86caf39a976d3f44c7e739f9245749f /src/server/game/AI/SmartScripts
parent478be1f7ea0b52381ff46339a789ad4fda8a7d40 (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 (cherry picked from commit ddf2f60c1317f0ce728d5894064f51251cf71c72)
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 7658a62d928..aac8edd3a37 100644
--- a/src/server/game/AI/SmartScripts/SmartAI.cpp
+++ b/src/server/game/AI/SmartScripts/SmartAI.cpp
@@ -692,6 +692,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)