mirror of
https://github.com/TrinityCore/TrinityCore.git
synced 2026-01-16 07:30:42 +01:00
Core/CreatureAI: Do not remove clone_caster auras on evade (in addition to control_vehicle auras)
This commit is contained in:
@@ -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();
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -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();
|
||||
|
||||
Reference in New Issue
Block a user