diff options
author | thenecromancer <none@none> | 2010-01-20 20:54:32 +0100 |
---|---|---|
committer | thenecromancer <none@none> | 2010-01-20 20:54:32 +0100 |
commit | 721c9262291833868b6c478410c23f732eca4d4b (patch) | |
tree | 23b53485981afd57654ebe2f9f10362771cd6cc9 /src/game/Unit.cpp | |
parent | bfad15470f38c2000313a53ec670b87e15bbf87b (diff) |
Change GetSpellSpecific() to have SpellEntry argument instead of ID, this saves lookups in spellstore for entries we already have.
--HG--
branch : trunk
Diffstat (limited to 'src/game/Unit.cpp')
-rw-r--r-- | src/game/Unit.cpp | 12 |
1 files changed, 10 insertions, 2 deletions
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) |