diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/game/SpellAuras.cpp | 2 | ||||
-rw-r--r-- | src/game/SpellMgr.cpp | 16 | ||||
-rw-r--r-- | src/game/SpellMgr.h | 2 | ||||
-rw-r--r-- | src/game/Unit.cpp | 12 |
4 files changed, 18 insertions, 14 deletions
diff --git a/src/game/SpellAuras.cpp b/src/game/SpellAuras.cpp index c71e12d0fc8..a3128ba7567 100644 --- a/src/game/SpellAuras.cpp +++ b/src/game/SpellAuras.cpp @@ -1209,7 +1209,7 @@ void Aura::HandleAuraSpecificMods(AuraApplication const * aurApp, Unit * caster, } break; case SPELLFAMILY_DEATHKNIGHT: - if (GetSpellSpecific(GetId()) == SPELL_SPECIFIC_PRESENCE) + if (GetSpellSpecific(GetSpellProto()) == SPELL_SPECIFIC_PRESENCE) { AuraEffect *bloodPresenceAura=0; // healing by damage done AuraEffect *frostPresenceAura=0; // increased health diff --git a/src/game/SpellMgr.cpp b/src/game/SpellMgr.cpp index 7e098c57bfc..5b6f73fce4f 100644 --- a/src/game/SpellMgr.cpp +++ b/src/game/SpellMgr.cpp @@ -464,12 +464,8 @@ AuraState GetSpellAuraState(SpellEntry const * spellInfo) return AURA_STATE_NONE; } -SpellSpecific GetSpellSpecific(uint32 spellId) +SpellSpecific GetSpellSpecific(SpellEntry const * spellInfo) { - SpellEntry const *spellInfo = sSpellStore.LookupEntry(spellId); - if(!spellInfo) - return SPELL_SPECIFIC_NORMAL; - switch(spellInfo->SpellFamilyName) { case SPELLFAMILY_GENERIC: @@ -1013,7 +1009,7 @@ bool IsSingleTargetSpell(SpellEntry const *spellInfo) if ( spellInfo->AttributesEx5 & SPELL_ATTR_EX5_SINGLE_TARGET_SPELL ) return true; - switch(GetSpellSpecific(spellInfo->Id)) + switch(GetSpellSpecific(spellInfo)) { case SPELL_SPECIFIC_JUDGEMENT: return true; @@ -1033,13 +1029,13 @@ bool IsSingleTargetSpells(SpellEntry const *spellInfo1, SpellEntry const *spellI return true; // TODO - need found Judgements rule - SpellSpecific spec1 = GetSpellSpecific(spellInfo1->Id); + SpellSpecific spec1 = GetSpellSpecific(spellInfo1); // spell with single target specific types switch(spec1) { case SPELL_SPECIFIC_JUDGEMENT: case SPELL_SPECIFIC_MAGE_POLYMORPH: - if(GetSpellSpecific(spellInfo2->Id) == spec1) + if(GetSpellSpecific(spellInfo2) == spec1) return true; break; default: @@ -3025,8 +3021,8 @@ bool SpellArea::IsFitToRequirements(Player const* player, uint32 newZone, uint32 bool SpellMgr::CanAurasStack(SpellEntry const *spellInfo_1, SpellEntry const *spellInfo_2, bool sameCaster) const { - SpellSpecific spellSpec_1 = GetSpellSpecific(spellInfo_1->Id); - SpellSpecific spellSpec_2 = GetSpellSpecific(spellInfo_2->Id); + SpellSpecific spellSpec_1 = GetSpellSpecific(spellInfo_1); + SpellSpecific spellSpec_2 = GetSpellSpecific(spellInfo_2); if (spellSpec_1 && spellSpec_2) if (IsSingleFromSpellSpecificPerTarget(spellSpec_1, spellSpec_2) || sameCaster && IsSingleFromSpellSpecificPerCaster(spellSpec_1, spellSpec_2)) diff --git a/src/game/SpellMgr.h b/src/game/SpellMgr.h index e6d053311a1..fb38e36bafd 100644 --- a/src/game/SpellMgr.h +++ b/src/game/SpellMgr.h @@ -187,7 +187,7 @@ enum SpellLinkedType SPELL_LINK_REMOVE = 0, }; -SpellSpecific GetSpellSpecific(uint32 spellId); +SpellSpecific GetSpellSpecific(SpellEntry const * spellInfo); AuraState GetSpellAuraState(SpellEntry const * spellInfo); // Different spell properties diff --git a/src/game/Unit.cpp b/src/game/Unit.cpp index 152fdd3ec3d..070cabbe563 100644 --- a/src/game/Unit.cpp +++ b/src/game/Unit.cpp @@ -6768,7 +6768,7 @@ bool Unit::HandleDummyAuraProc(Unit *pVictim, uint32 damage, AuraEffect* trigger chance = 15.0f; } // Judgement (any) - else if (GetSpellSpecific(procSpell->Id) == SPELL_SPECIFIC_JUDGEMENT) + else if (GetSpellSpecific(procSpell) == SPELL_SPECIFIC_JUDGEMENT) { triggered_spell_id = 40472; chance = 50.0f; @@ -13828,7 +13828,15 @@ void Unit::SetStandState(uint8 state) bool Unit::IsPolymorphed() const { - return GetSpellSpecific(getTransForm())==SPELL_SPECIFIC_MAGE_POLYMORPH; + uint32 transformId = getTransForm(); + if (!transformId) + return false; + + const SpellEntry *spellInfo=sSpellStore.LookupEntry(transformId); + if (!spellInfo) + return false; + + return GetSpellSpecific(spellInfo)==SPELL_SPECIFIC_MAGE_POLYMORPH; } void Unit::SetDisplayId(uint32 modelId) |