Core/AI: Finally move the "is creature engaged" flag to be a property of the creature AI, where it honestly always belonged.
Port From (https://github.com/TrinityCore/TrinityCore/commit/c13d83796f7b2111c5dcf8546bdd84eccd232ae3)
This commit is contained in:
@@ -57,8 +57,9 @@ namespace Game.Entities
|
||||
RemoveAurasWithInterruptFlags(SpellAuraInterruptFlags.LeavingCombat);
|
||||
}
|
||||
|
||||
public virtual void AtEngage(Unit target) { m_isEngaged = true; }
|
||||
public virtual void AtDisengage() { m_isEngaged = false; }
|
||||
public virtual void AtEngage(Unit target) { }
|
||||
|
||||
public virtual void AtDisengage() { }
|
||||
|
||||
public void CombatStop(bool includingCast = false, bool mutualPvP = true)
|
||||
{
|
||||
@@ -147,10 +148,10 @@ namespace Game.Entities
|
||||
|
||||
public bool CanHaveThreatList() { return m_threatManager.CanHaveThreatList(); }
|
||||
|
||||
// This value can be different from IsInCombat:
|
||||
// This value can be different from IsInCombat, for example:
|
||||
// - when a projectile spell is midair against a creature (combat on launch - threat+aggro on impact)
|
||||
// - when the creature has no targets left, but the AI has not yet ceased engaged logic
|
||||
public bool IsEngaged() { return m_isEngaged; }
|
||||
public virtual bool IsEngaged() { return IsInCombat(); }
|
||||
|
||||
public bool IsEngagedBy(Unit who) { return CanHaveThreatList() ? IsThreatenedBy(who) : IsInCombatWith(who); }
|
||||
|
||||
@@ -230,7 +231,6 @@ namespace Game.Entities
|
||||
minion.StopAttackFaction(factionId);
|
||||
}
|
||||
|
||||
|
||||
public void HandleProcExtraAttackFor(Unit victim)
|
||||
{
|
||||
while (ExtraAttacks != 0)
|
||||
|
||||
@@ -56,8 +56,6 @@ namespace Game.Entities
|
||||
protected uint[] m_attackTimer = new uint[(int)WeaponAttackType.Max];
|
||||
|
||||
// Threat+combat management
|
||||
bool m_isEngaged;
|
||||
|
||||
CombatManager m_combatManager;
|
||||
ThreatManager m_threatManager;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user