Core/Units: Made RemoveAllAurasExceptVehicle more generic, can now be used to remove all auras except specified type
This commit is contained in:
@@ -549,11 +549,8 @@ inline bool CreatureAI::_EnterEvadeMode()
|
||||
if (!me->isAlive())
|
||||
return false;
|
||||
|
||||
// call specialized vehicle remove auras if creature is one
|
||||
if (!me->IsVehicle())
|
||||
me->RemoveAllAuras();
|
||||
else
|
||||
me->RemoveAllAurasExceptVehicle();
|
||||
// dont remove vehicle auras, passengers arent supposed to drop off the vehicle
|
||||
me->RemoveAllAurasExceptType(SPELL_AURA_CONTROL_VEHICLE);
|
||||
|
||||
// sometimes bosses stuck in combat?
|
||||
me->DeleteThreatList();
|
||||
|
||||
@@ -4010,12 +4010,12 @@ void Unit::RemoveAllAurasRequiringDeadTarget()
|
||||
}
|
||||
}
|
||||
|
||||
void Unit::RemoveAllAurasExceptVehicle()
|
||||
void Unit::RemoveAllAurasExceptType(AuraType type)
|
||||
{
|
||||
for (AuraApplicationMap::iterator iter = m_appliedAuras.begin(); iter != m_appliedAuras.end();)
|
||||
{
|
||||
Aura const* aura = iter->second->GetBase();
|
||||
if (!IsSpellHaveAura(aura->GetSpellProto(), SPELL_AURA_CONTROL_VEHICLE))
|
||||
if (!IsSpellHaveAura(aura->GetSpellProto(), type))
|
||||
_UnapplyAura(iter, AURA_REMOVE_BY_DEFAULT);
|
||||
else
|
||||
++iter;
|
||||
@@ -4024,7 +4024,7 @@ void Unit::RemoveAllAurasExceptVehicle()
|
||||
for (AuraMap::iterator iter = m_ownedAuras.begin(); iter != m_ownedAuras.end();)
|
||||
{
|
||||
Aura* aura = iter->second;
|
||||
if (!IsSpellHaveAura(aura->GetSpellProto(), SPELL_AURA_CONTROL_VEHICLE))
|
||||
if (!IsSpellHaveAura(aura->GetSpellProto(), type))
|
||||
RemoveOwnedAura(iter, AURA_REMOVE_BY_DEFAULT);
|
||||
else
|
||||
++iter;
|
||||
|
||||
@@ -1664,7 +1664,7 @@ class Unit : public WorldObject
|
||||
void RemoveArenaAuras(bool onleave = false);
|
||||
void RemoveAllAurasOnDeath();
|
||||
void RemoveAllAurasRequiringDeadTarget();
|
||||
void RemoveAllAurasExceptVehicle();
|
||||
void RemoveAllAurasExceptType(AuraType type);
|
||||
void DelayOwnedAuras(uint32 spellId, uint64 caster, int32 delaytime);
|
||||
|
||||
void _RemoveAllAuraStatMods();
|
||||
|
||||
Reference in New Issue
Block a user