diff options
author | megamage <none@none> | 2009-08-11 11:32:32 -0500 |
---|---|---|
committer | megamage <none@none> | 2009-08-11 11:32:32 -0500 |
commit | 08d4aac16153c6ea87fb74f129ca1bafbe2a3f6b (patch) | |
tree | 9784225cc3748572b0e74743497f0e1f90d6356b /src | |
parent | d4165ac36e9bc91081e192065b9ab1854096e9f6 (diff) |
*Consider all non-existing spells as negative. This fixes the broken Forbearance.
--HG--
branch : trunk
Diffstat (limited to 'src')
-rw-r--r-- | src/game/SpellMgr.cpp | 14 |
1 files changed, 10 insertions, 4 deletions
diff --git a/src/game/SpellMgr.cpp b/src/game/SpellMgr.cpp index ca01f4422b7..c353bc9fa6d 100644 --- a/src/game/SpellMgr.cpp +++ b/src/game/SpellMgr.cpp @@ -954,17 +954,23 @@ bool SpellMgr::_isPositiveEffect(uint32 spellId, uint32 effIndex, bool deep) con bool IsPositiveSpell(uint32 spellId) { - return !(spellmgr.GetSpellCustomAttr(spellId) & SPELL_ATTR_CU_NEGATIVE); + uint32 attr = spellmgr.GetSpellCustomAttr(spellId); // non-existing spells such as 61988 (Forbearance) + if(!attr) + return false; + return !(attr & SPELL_ATTR_CU_NEGATIVE); } bool IsPositiveEffect(uint32 spellId, uint32 effIndex) { + uint32 attr = spellmgr.GetSpellCustomAttr(spellId); + if(!attr) + return false; switch(effIndex) { default: - case 0: return !(spellmgr.GetSpellCustomAttr(spellId) & SPELL_ATTR_CU_NEGATIVE_EFF0); - case 1: return !(spellmgr.GetSpellCustomAttr(spellId) & SPELL_ATTR_CU_NEGATIVE_EFF1); - case 2: return !(spellmgr.GetSpellCustomAttr(spellId) & SPELL_ATTR_CU_NEGATIVE_EFF2); + case 0: return !(attr & SPELL_ATTR_CU_NEGATIVE_EFF0); + case 1: return !(attr & SPELL_ATTR_CU_NEGATIVE_EFF1); + case 2: return !(attr & SPELL_ATTR_CU_NEGATIVE_EFF2); } } |