Core/CreatureAI: Do not remove clone_caster auras on evade (in addition to control_vehicle auras)

This commit is contained in:
Nay
2013-08-11 15:52:23 +01:00
parent 54d2b73f3c
commit d0bde02b21
3 changed files with 31 additions and 8 deletions

View File

@@ -225,8 +225,9 @@ bool CreatureAI::_EnterEvadeMode()
if (!me->IsAlive())
return false;
// dont remove vehicle auras, passengers arent supposed to drop off the vehicle
me->RemoveAllAurasExceptType(SPELL_AURA_CONTROL_VEHICLE);
// don't remove vehicle auras, passengers aren't supposed to drop off the vehicle
// don't remove clone caster on evade (to be verified)
me->RemoveAllAurasExceptType(SPELL_AURA_CONTROL_VEHICLE, SPELL_AURA_CLONE_CASTER);
// sometimes bosses stuck in combat?
me->DeleteThreatList();

View File

@@ -4068,19 +4068,40 @@ void Unit::RemoveAllAurasExceptType(AuraType type)
for (AuraApplicationMap::iterator iter = m_appliedAuras.begin(); iter != m_appliedAuras.end();)
{
Aura const* aura = iter->second->GetBase();
if (!aura->GetSpellInfo()->HasAura(type))
_UnapplyAura(iter, AURA_REMOVE_BY_DEFAULT);
else
if (aura->GetSpellInfo()->HasAura(type))
++iter;
else
_UnapplyAura(iter, AURA_REMOVE_BY_DEFAULT);
}
for (AuraMap::iterator iter = m_ownedAuras.begin(); iter != m_ownedAuras.end();)
{
Aura* aura = iter->second;
if (!aura->GetSpellInfo()->HasAura(type))
RemoveOwnedAura(iter, AURA_REMOVE_BY_DEFAULT);
else
if (aura->GetSpellInfo()->HasAura(type))
++iter;
else
RemoveOwnedAura(iter, AURA_REMOVE_BY_DEFAULT);
}
}
void Unit::RemoveAllAurasExceptType(AuraType type1, AuraType type2)
{
for (AuraApplicationMap::iterator iter = m_appliedAuras.begin(); iter != m_appliedAuras.end();)
{
Aura const* aura = iter->second->GetBase();
if (aura->GetSpellInfo()->HasAura(type1) || aura->GetSpellInfo()->HasAura(type2))
++iter;
else
_UnapplyAura(iter, AURA_REMOVE_BY_DEFAULT);
}
for (AuraMap::iterator iter = m_ownedAuras.begin(); iter != m_ownedAuras.end();)
{
Aura* aura = iter->second;
if (aura->GetSpellInfo()->HasAura(type1) || aura->GetSpellInfo()->HasAura(type2))
++iter;
else
RemoveOwnedAura(iter, AURA_REMOVE_BY_DEFAULT);
}
}

View File

@@ -1743,6 +1743,7 @@ class Unit : public WorldObject
void RemoveAllAurasOnDeath();
void RemoveAllAurasRequiringDeadTarget();
void RemoveAllAurasExceptType(AuraType type);
void RemoveAllAurasExceptType(AuraType type1, AuraType type2); /// @todo: once we support variadic templates use them here
void DelayOwnedAuras(uint32 spellId, uint64 caster, int32 delaytime);
void _RemoveAllAuraStatMods();