[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

@ -3063,7 +3063,7 @@ bool Player::addSpell(uint32 spell_id, bool active, bool learning, bool dependen
if(active)
{
if (IsPassiveSpell(spell_id) && IsNeedCastPassiveSpellAtLearn(spellInfo))
if (IsPassiveSpell(spellInfo) && IsNeedCastPassiveSpellAtLearn(spellInfo))
CastSpell (this, spell_id, true);
}
else if(IsInWorld())
@ -3254,7 +3254,7 @@ bool Player::addSpell(uint32 spell_id, bool active, bool learning, bool dependen
CastSpell(this, spell_id, true);
}
// also cast passive spells (including all talents without SPELL_EFFECT_LEARN_SPELL) with additional checks
else if (IsPassiveSpell(spell_id))
else if (IsPassiveSpell(spellInfo))
{
if (IsNeedCastPassiveSpellAtLearn(spellInfo))
CastSpell(this, spell_id, true);