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
+3
View File
@@ -185,6 +185,8 @@ namespace Game.AI
// Called when creature appears in the world (spawn, respawn, grid load etc...) // Called when creature appears in the world (spawn, respawn, grid load etc...)
public virtual void JustAppeared() public virtual void JustAppeared()
{
if (!IsEngaged())
{ {
TempSummon summon = me.ToTempSummon(); TempSummon summon = me.ToTempSummon();
if (summon != null) if (summon != null)
@@ -201,6 +203,7 @@ namespace Game.AI
} }
} }
} }
}
public override void JustEnteredCombat(Unit who) public override void JustEnteredCombat(Unit who)
{ {
+7 -2
View File
@@ -59,9 +59,14 @@ namespace Game.Combat
if (cWho.IsPet() || cWho.IsTotem() || cWho.IsTrigger()) if (cWho.IsPet() || cWho.IsTotem() || cWho.IsTrigger())
return false; return false;
// summons cannot have a threat list, unless they are controlled by a creature // summons cannot have a threat list if they were summoned by a player
if (cWho.HasUnitTypeMask(UnitTypeMask.Minion | UnitTypeMask.Guardian) && !cWho.GetOwnerGUID().IsCreature()) if (cWho.HasUnitTypeMask(UnitTypeMask.Minion | UnitTypeMask.Guardian))
{
TempSummon tWho = cWho.ToTempSummon();
if (tWho != null)
if (tWho.GetSummonerGUID().IsPlayer())
return false; return false;
}
return true; return true;
} }