Core/AI: Make charmed creatures follow their owner

Port From (https://github.com/TrinityCore/TrinityCore/commit/144cfc2bcebbd0d2bbce5f97a06f634d17d62e79)
This commit is contained in:
hondacrx
2022-01-07 11:12:23 -05:00
parent 69da866100
commit b30ded6189
2 changed files with 11 additions and 0 deletions
+8
View File
@@ -623,6 +623,14 @@ namespace Game.AI
_allySet.Add(owner.GetGUID()); _allySet.Add(owner.GetGUID());
} }
public override void OnCharmed(bool isNew)
{
if (me.IsCharmed())
me.GetMotionMaster().MoveFollow(me.GetCharmer(), SharedConst.PetFollowDist, me.GetFollowAngle());
base.OnCharmed(isNew);
}
void ClearCharmInfoFlags() void ClearCharmInfoFlags()
{ {
// Quick access to set all flags to FALSE // Quick access to set all flags to FALSE
+3
View File
@@ -741,6 +741,9 @@ namespace Game.AI
_isCharmed = charmed; _isCharmed = charmed;
if (charmed)
me.GetMotionMaster().MoveFollow(me.GetCharmer(), SharedConst.PetFollowDist, me.GetFollowAngle());
if (!charmed && !me.IsInEvadeMode()) if (!charmed && !me.IsInEvadeMode())
{ {
if (_repeatWaypointPath) if (_repeatWaypointPath)