*Correctly check ispositive for spells.
--HG-- branch : trunk
This commit is contained in:
@@ -950,23 +950,21 @@ bool SpellMgr::_isPositiveEffect(uint32 spellId, uint32 effIndex, bool deep) con
|
|||||||
|
|
||||||
bool IsPositiveSpell(uint32 spellId)
|
bool IsPositiveSpell(uint32 spellId)
|
||||||
{
|
{
|
||||||
uint32 attr = spellmgr.GetSpellCustomAttr(spellId); // non-existing spells such as 61988 (Forbearance)
|
if(!sSpellStore.LookupEntry(spellId)) // non-existing spells such as 61988 (Forbearance)
|
||||||
if(!attr)
|
|
||||||
return false;
|
return false;
|
||||||
return !(attr & SPELL_ATTR_CU_NEGATIVE);
|
return !(spellmgr.GetSpellCustomAttr(spellId) & SPELL_ATTR_CU_NEGATIVE);
|
||||||
}
|
}
|
||||||
|
|
||||||
bool IsPositiveEffect(uint32 spellId, uint32 effIndex)
|
bool IsPositiveEffect(uint32 spellId, uint32 effIndex)
|
||||||
{
|
{
|
||||||
uint32 attr = spellmgr.GetSpellCustomAttr(spellId);
|
if(!sSpellStore.LookupEntry(spellId))
|
||||||
if(!attr)
|
|
||||||
return false;
|
return false;
|
||||||
switch(effIndex)
|
switch(effIndex)
|
||||||
{
|
{
|
||||||
default:
|
default:
|
||||||
case 0: return !(attr & SPELL_ATTR_CU_NEGATIVE_EFF0);
|
case 0: return !(spellmgr.GetSpellCustomAttr(spellId) & SPELL_ATTR_CU_NEGATIVE_EFF0);
|
||||||
case 1: return !(attr & SPELL_ATTR_CU_NEGATIVE_EFF1);
|
case 1: return !(spellmgr.GetSpellCustomAttr(spellId) & SPELL_ATTR_CU_NEGATIVE_EFF1);
|
||||||
case 2: return !(attr & SPELL_ATTR_CU_NEGATIVE_EFF2);
|
case 2: return !(spellmgr.GetSpellCustomAttr(spellId) & SPELL_ATTR_CU_NEGATIVE_EFF2);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user