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:
@@ -290,7 +290,7 @@ namespace Game.AI
|
|||||||
|
|
||||||
public bool _EnterEvadeMode(EvadeReason why = EvadeReason.Other)
|
public bool _EnterEvadeMode(EvadeReason why = EvadeReason.Other)
|
||||||
{
|
{
|
||||||
if (me.IsInEvadeMode())
|
if (!IsEngaged())
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
if (!me.IsAlive())
|
if (!me.IsAlive())
|
||||||
@@ -455,11 +455,7 @@ namespace Game.AI
|
|||||||
public virtual void JustEngagedWith(Unit who) { }
|
public virtual void JustEngagedWith(Unit who) { }
|
||||||
|
|
||||||
// Called when the creature is killed
|
// Called when the creature is killed
|
||||||
public virtual void JustDied(Unit killer)
|
public virtual void JustDied(Unit killer) { }
|
||||||
{
|
|
||||||
if (IsEngaged())
|
|
||||||
EngagementOver();
|
|
||||||
}
|
|
||||||
|
|
||||||
// Called when the creature kills a unit
|
// Called when the creature kills a unit
|
||||||
public virtual void KilledUnit(Unit victim) { }
|
public virtual void KilledUnit(Unit victim) { }
|
||||||
|
|||||||
@@ -214,11 +214,7 @@ namespace Game.Maps
|
|||||||
creature.RemoveAllAreaTriggers();
|
creature.RemoveAllAreaTriggers();
|
||||||
|
|
||||||
if (creature.IsInCombat())
|
if (creature.IsInCombat())
|
||||||
{
|
|
||||||
creature.CombatStop();
|
creature.CombatStop();
|
||||||
if (creature.IsAIEnabled())
|
|
||||||
creature.GetAI().EnterEvadeMode();
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user