Core/Units: Made RemoveAllAurasExceptVehicle more generic, can now be used to remove all auras except specified type

This commit is contained in:
Shauren
2011-04-23 10:24:44 +02:00
parent 05ef35c355
commit 8dbdc15705
3 changed files with 6 additions and 9 deletions
+2 -5
View File
@@ -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();
+3 -3
View File
@@ -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;
+1 -1
View File
@@ -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();