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 ddf2f60c13)
This commit is contained in:
Giacomo Pozzoni
2020-03-01 13:31:14 +01:00
committed by Shauren
parent 478be1f7ea
commit 144cfc2bce
3 changed files with 12 additions and 0 deletions

View File

@@ -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)