From d255912aa67d43e1514a58c7c1684349ce683c62 Mon Sep 17 00:00:00 2001 From: hondacrx Date: Fri, 24 Dec 2021 20:22:19 -0500 Subject: [PATCH] Core/AI: minimize further undesired behaviours Port From (https://github.com/TrinityCore/TrinityCore/commit/d7e544e81626ab477024c057e3e7a2a45083f3a7) --- Source/Game/AI/CoreAI/CreatureAI.cs | 23 ++++++++++++++++------- 1 file changed, 16 insertions(+), 7 deletions(-) diff --git a/Source/Game/AI/CoreAI/CreatureAI.cs b/Source/Game/AI/CoreAI/CreatureAI.cs index a8a93d5d8..3cac478b8 100644 --- a/Source/Game/AI/CoreAI/CreatureAI.cs +++ b/Source/Game/AI/CoreAI/CreatureAI.cs @@ -152,14 +152,23 @@ namespace Game.AI // Called when creature appears in the world (spawn, respawn, grid load etc...) public virtual void JustAppeared() { - if (me.GetVehicle() == null) + // Filter which type of summons apply the following follow handling + if (!me.IsSummon()) + return; + + TempSummon summon = me.ToTempSummon(); + if (summon.m_Properties.Control != SummonCategory.Unk && summon.m_Properties.Control != SummonCategory.Pet) + return; + + // Not applied to vehicles + if (summon.GetVehicle()) + return; + + Unit owner = summon.GetCharmerOrOwner(); + if (owner != null) { - Unit owner = me.GetCharmerOrOwner(); - if (owner != null) - { - me.GetMotionMaster().Clear(); - me.GetMotionMaster().MoveFollow(owner, SharedConst.PetFollowDist, me.GetFollowAngle()); - } + summon.GetMotionMaster().Clear(); + summon.GetMotionMaster().MoveFollow(owner, SharedConst.PetFollowDist, summon.GetFollowAngle()); } }