Core/Creatures: Implemented CREATURE_STATIC_FLAG_2_IGNORE_SANCTUARY (ignore SPELL_EFFECT_SANCTUARY, used by Vanish)
This commit is contained in:
1 parent
a4aa09de52
commit
a7644b03d4
9 files changed
+73
-33
No files matched your search
@@ -5530,23 +5530,32 @@ void Unit::ValidateAttackersAndOwnTarget()
|
||||
AttackStop();
|
||||
}
|
||||
|
||||
void Unit::CombatStop(bool includingCast, bool mutualPvP)
|
||||
void Unit::CombatStop(bool includingCast, bool mutualPvP, bool (*unitFilter)(Unit const* otherUnit))
|
||||
{
|
||||
if (includingCast && IsNonMeleeSpellCast(false))
|
||||
InterruptNonMeleeSpells(false);
|
||||
|
||||
AttackStop();
|
||||
RemoveAllAttackers();
|
||||
|
||||
if (!unitFilter)
|
||||
RemoveAllAttackers();
|
||||
else
|
||||
{
|
||||
std::vector<Unit*> attackersToRemove;
|
||||
attackersToRemove.reserve(m_attackers.size());
|
||||
std::copy_if(m_attackers.begin(), m_attackers.end(), std::back_inserter(attackersToRemove), unitFilter);
|
||||
|
||||
for (Unit* attacker : attackersToRemove)
|
||||
attacker->AttackStop();
|
||||
}
|
||||
if (GetTypeId() == TYPEID_PLAYER)
|
||||
ToPlayer()->SendAttackSwingCancelAttack(); // melee and ranged forced attack cancel
|
||||
|
||||
m_combatManager.EndAllPvECombat(unitFilter);
|
||||
if (mutualPvP)
|
||||
ClearInCombat();
|
||||
else
|
||||
{ // vanish and brethren are weird
|
||||
m_combatManager.EndAllPvECombat();
|
||||
m_combatManager.SuppressPvPCombat();
|
||||
}
|
||||
m_combatManager.EndAllPvPCombat(unitFilter);
|
||||
else // vanish and brethren are weird
|
||||
m_combatManager.SuppressPvPCombat(unitFilter);
|
||||
}
|
||||
|
||||
void Unit::CombatStopWithPets(bool includingCast)
|
||||
|
||||
Reference in new issue
Block a user