aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authormegamage <none@none>2009-08-11 13:11:16 -0500
committermegamage <none@none>2009-08-11 13:11:16 -0500
commit177f78be1a06f14510aa7413e51318aa49b6ea4f (patch)
tree642b54717843009174707eb58d5cbcf63f9923d7 /src
parente2e70b936b5fe30cc6c7592c8a6a1e870b9420ad (diff)
*Correctly check ispositive for spells.
--HG-- branch : trunk
Diffstat (limited to 'src')
-rw-r--r--src/game/SpellMgr.cpp14
1 files changed, 6 insertions, 8 deletions
diff --git a/src/game/SpellMgr.cpp b/src/game/SpellMgr.cpp
index b1e5279166a..4e52af4bf9b 100644
--- a/src/game/SpellMgr.cpp
+++ b/src/game/SpellMgr.cpp
@@ -950,23 +950,21 @@ bool SpellMgr::_isPositiveEffect(uint32 spellId, uint32 effIndex, bool deep) con
bool IsPositiveSpell(uint32 spellId)
{
- uint32 attr = spellmgr.GetSpellCustomAttr(spellId); // non-existing spells such as 61988 (Forbearance)
- if(!attr)
+ if(!sSpellStore.LookupEntry(spellId)) // non-existing spells such as 61988 (Forbearance)
return false;
- return !(attr & SPELL_ATTR_CU_NEGATIVE);
+ return !(spellmgr.GetSpellCustomAttr(spellId) & SPELL_ATTR_CU_NEGATIVE);
}
bool IsPositiveEffect(uint32 spellId, uint32 effIndex)
{
- uint32 attr = spellmgr.GetSpellCustomAttr(spellId);
- if(!attr)
+ if(!sSpellStore.LookupEntry(spellId))
return false;
switch(effIndex)
{
default:
- 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);
+ 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);
}
}