Core/AI: No longer do strange things when told to enter evade mode while there's no need to do so, typically by terrible legacy code.

Port From (https://github.com/TrinityCore/TrinityCore/commit/3269c4278933d65ef0df619a50cbd0b851cab4fc)
This commit is contained in:
hondacrx
2022-01-01 17:58:34 -05:00
parent 0ae91739bc
commit e7ab9031ac
2 changed files with 2 additions and 10 deletions
+2 -6
View File
@@ -290,7 +290,7 @@ namespace Game.AI
public bool _EnterEvadeMode(EvadeReason why = EvadeReason.Other)
{
if (me.IsInEvadeMode())
if (!IsEngaged())
return false;
if (!me.IsAlive())
@@ -455,11 +455,7 @@ namespace Game.AI
public virtual void JustEngagedWith(Unit who) { }
// Called when the creature is killed
public virtual void JustDied(Unit killer)
{
if (IsEngaged())
EngagementOver();
}
public virtual void JustDied(Unit killer) { }
// Called when the creature kills a unit
public virtual void KilledUnit(Unit victim) { }