mirror of
https://github.com/liyunfan1223/azerothcore-wotlk.git
synced 2026-08-08 15:58:04 +00:00
fix(Core/Spells): Fix movement impairment auras not being removed (#19684)
This commit is contained in:
@@ -5185,17 +5185,12 @@ void Unit::RemoveMovementImpairingAuras(bool withRoot)
|
|||||||
for (AuraApplicationMap::iterator iter = m_appliedAuras.begin(); iter != m_appliedAuras.end();)
|
for (AuraApplicationMap::iterator iter = m_appliedAuras.begin(); iter != m_appliedAuras.end();)
|
||||||
{
|
{
|
||||||
Aura const* aura = iter->second->GetBase();
|
Aura const* aura = iter->second->GetBase();
|
||||||
if (aura->GetSpellInfo()->Mechanic == MECHANIC_SNARE)
|
if (aura->GetSpellInfo()->Mechanic == MECHANIC_SNARE || aura->GetSpellInfo()->HasEffectMechanic(MECHANIC_SNARE))
|
||||||
{
|
{
|
||||||
RemoveAura(iter);
|
RemoveAura(iter);
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Xinef: turn off snare auras by setting amount to 0 :)
|
|
||||||
for (uint8 i = 0; i < MAX_SPELL_EFFECTS; ++i)
|
|
||||||
if (((1 << i) & iter->second->GetEffectMask()) && aura->GetSpellInfo()->Effects[i].Mechanic == MECHANIC_SNARE)
|
|
||||||
aura->GetEffect(i)->ChangeAmount(0);
|
|
||||||
|
|
||||||
++iter;
|
++iter;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -880,6 +880,15 @@ bool SpellInfo::HasEffect(SpellEffects effect) const
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bool SpellInfo::HasEffectMechanic(Mechanics mechanic) const
|
||||||
|
{
|
||||||
|
for (auto const& effect : Effects)
|
||||||
|
if (effect.Mechanic == mechanic)
|
||||||
|
return true;
|
||||||
|
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
bool SpellInfo::HasAura(AuraType aura) const
|
bool SpellInfo::HasAura(AuraType aura) const
|
||||||
{
|
{
|
||||||
for (uint8 i = 0; i < MAX_SPELL_EFFECTS; ++i)
|
for (uint8 i = 0; i < MAX_SPELL_EFFECTS; ++i)
|
||||||
|
|||||||
@@ -407,6 +407,7 @@ public:
|
|||||||
|
|
||||||
uint32 GetCategory() const;
|
uint32 GetCategory() const;
|
||||||
bool HasEffect(SpellEffects effect) const;
|
bool HasEffect(SpellEffects effect) const;
|
||||||
|
bool HasEffectMechanic(Mechanics mechanic) const;
|
||||||
bool HasAura(AuraType aura) const;
|
bool HasAura(AuraType aura) const;
|
||||||
bool HasAnyAura() const;
|
bool HasAnyAura() const;
|
||||||
bool HasAreaAuraEffect() const;
|
bool HasAreaAuraEffect() const;
|
||||||
|
|||||||
Reference in New Issue
Block a user