[10074] Add IsPassive(SpellEntry*) function and use in cases wjern entry already known.

Some other small code cleanups
This commit is contained in:
VladimirMangos 2010-06-18 02:16:29 +04:00
parent 6ca609629c
commit 07a931e141
12 changed files with 35 additions and 33 deletions

View file

@ -4006,7 +4006,7 @@ bool Unit::RemoveNoStackAurasDueToAura(Aura *Aur)
SpellEffectIndex effIndex = Aur->GetEffIndex();
// passive spell special case (only non stackable with ranks)
if(IsPassiveSpell(spellId))
if(IsPassiveSpell(spellProto))
{
if(IsPassiveSpellStackableWithRanks(spellProto))
return true;
@ -4029,7 +4029,7 @@ bool Unit::RemoveNoStackAurasDueToAura(Aura *Aur)
uint32 i_spellId = i_spellProto->Id;
// early checks that spellId is passive non stackable spell
if(IsPassiveSpell(i_spellId))
if(IsPassiveSpell(i_spellProto))
{
// passive non-stackable spells not stackable only for same caster
if(Aur->GetCasterGUID()!=i->second->GetCasterGUID())
@ -8610,7 +8610,7 @@ void Unit::ModifyAuraState(AuraState flag, bool apply)
{
if(itr->second.state == PLAYERSPELL_REMOVED) continue;
SpellEntry const *spellInfo = sSpellStore.LookupEntry(itr->first);
if (!spellInfo || !IsPassiveSpell(itr->first)) continue;
if (!spellInfo || !IsPassiveSpell(spellInfo)) continue;
if (spellInfo->CasterAuraState == flag)
CastSpell(this, itr->first, true, NULL);
}