Core/AI: No longer override chase movement with follow movement if the creature engages before JustAppeared has had a chance to fire.

Port From (https://github.com/TrinityCore/TrinityCore/commit/a4c2c0fb1d1b9fae832ecc52aa68fe3fb8d1ca52)
This commit is contained in:
hondacrx
2022-01-01 17:08:13 -05:00
parent 942feb2c3e
commit 077cdc5d23
2 changed files with 19 additions and 11 deletions
+11 -8
View File
@@ -186,17 +186,20 @@ namespace Game.AI
// Called when creature appears in the world (spawn, respawn, grid load etc...)
public virtual void JustAppeared()
{
TempSummon summon = me.ToTempSummon();
if (summon != null)
if (!IsEngaged())
{
// Only apply this to specific types of summons
if (!summon.GetVehicle() && ShouldFollowOnSpawn(summon.m_Properties))
TempSummon summon = me.ToTempSummon();
if (summon != null)
{
Unit owner = summon.GetCharmerOrOwner();
if (owner != null)
// Only apply this to specific types of summons
if (!summon.GetVehicle() && ShouldFollowOnSpawn(summon.m_Properties))
{
summon.GetMotionMaster().Clear();
summon.GetMotionMaster().MoveFollow(owner, SharedConst.PetFollowDist, summon.GetFollowAngle());
Unit owner = summon.GetCharmerOrOwner();
if (owner != null)
{
summon.GetMotionMaster().Clear();
summon.GetMotionMaster().MoveFollow(owner, SharedConst.PetFollowDist, summon.GetFollowAngle());
}
}
}
}