Skip to content

Commit

Permalink
fix(Core/Spells): Fix movement impairment auras not being removed (az…
Browse files Browse the repository at this point in the history
  • Loading branch information
Nyeriah authored Aug 22, 2024
1 parent 7037108 commit c0b6eae
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 6 deletions.
7 changes: 1 addition & 6 deletions src/server/game/Entities/Unit/Unit.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
}
Expand Down
9 changes: 9 additions & 0 deletions src/server/game/Spells/SpellInfo.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
1 change: 1 addition & 0 deletions src/server/game/Spells/SpellInfo.h
Original file line number Diff line number Diff line change
Expand Up @@ -407,6 +407,7 @@ friend class SpellMgr;

uint32 GetCategory() const;
bool HasEffect(SpellEffects effect) const;
bool HasEffectMechanic(Mechanics mechanic) const;
bool HasAura(AuraType aura) const;
bool HasAnyAura() const;
bool HasAreaAuraEffect() const;
Expand Down

0 comments on commit c0b6eae

Please sign in to comment.