[10232] Fix mechanic-related check, thanks to VladimirMangos

This commit is contained in:
Laise 2010-07-20 13:19:47 +03:00
parent 0065693c4c
commit d8c1374fcd
6 changed files with 14 additions and 8 deletions

View file

@ -8748,16 +8748,22 @@ void SpellAuraHolder::RefreshHolder()
SendAuraUpdate(false);
}
bool SpellAuraHolder::HasAuraAndMechanicEffect(uint32 mechanic) const
bool SpellAuraHolder::HasMechanic(uint32 mechanic) const
{
if (mechanic == m_spellProto->Mechanic)
return true;
for (int32 i = 0; i < MAX_EFFECT_INDEX; ++i)
if (m_auras[i] && m_spellProto->EffectMechanic[i] == mechanic)
return true;
return false;
}
bool SpellAuraHolder::HasAuraAndMechanicEffectMask(uint32 mechanicMask) const
bool SpellAuraHolder::HasMechanicMask(uint32 mechanicMask) const
{
if (mechanicMask & (1 << (m_spellProto->Mechanic - 1)))
return true;
for (int32 i = 0; i < MAX_EFFECT_INDEX; ++i)
if (m_auras[i] && m_spellProto->EffectMechanic[i] & mechanicMask)
return true;