mirror of
https://github.com/mod-playerbots/azerothcore-wotlk.git
synced 2026-01-13 09:17:18 +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();)
|
||||
{
|
||||
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);
|
||||
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;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -880,6 +880,15 @@ bool SpellInfo::HasEffect(SpellEffects effect) const
|
||||
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
|
||||
{
|
||||
for (uint8 i = 0; i < MAX_SPELL_EFFECTS; ++i)
|
||||
|
||||
@@ -407,6 +407,7 @@ public:
|
||||
|
||||
uint32 GetCategory() const;
|
||||
bool HasEffect(SpellEffects effect) const;
|
||||
bool HasEffectMechanic(Mechanics mechanic) const;
|
||||
bool HasAura(AuraType aura) const;
|
||||
bool HasAnyAura() const;
|
||||
bool HasAreaAuraEffect() const;
|
||||
|
||||
Reference in New Issue
Block a user