Properly stop attacking after player leaves ffa area (like Gurubashi Arena)
Port From (https://github.com/TrinityCore/TrinityCore/commit/4380fe2751869e7a011d51ee9449e8723b00067f)
This commit is contained in:
@@ -225,6 +225,24 @@ namespace Game.Entities
|
||||
}
|
||||
}
|
||||
|
||||
public void ValidateAttackersAndOwnTarget()
|
||||
{
|
||||
// iterate attackers
|
||||
List<Unit> toRemove = new List<Unit>();
|
||||
foreach (Unit attacker in getAttackers())
|
||||
if (!attacker.IsValidAttackTarget(this))
|
||||
toRemove.Add(attacker);
|
||||
|
||||
foreach (Unit attacker in toRemove)
|
||||
attacker.AttackStop();
|
||||
|
||||
// remove our own victim
|
||||
Unit victim = GetVictim();
|
||||
if (victim != null)
|
||||
if (!IsValidAttackTarget(victim))
|
||||
AttackStop();
|
||||
}
|
||||
|
||||
public void CombatStop(bool includingCast = false)
|
||||
{
|
||||
if (includingCast && IsNonMeleeSpellCast(false))
|
||||
|
||||
Reference in New Issue
Block a user