aboutsummaryrefslogtreecommitdiff
path: root/src/game/Unit.cpp
diff options
context:
space:
mode:
authorthenecromancer <none@none>2010-01-20 20:54:32 +0100
committerthenecromancer <none@none>2010-01-20 20:54:32 +0100
commit721c9262291833868b6c478410c23f732eca4d4b (patch)
tree23b53485981afd57654ebe2f9f10362771cd6cc9 /src/game/Unit.cpp
parentbfad15470f38c2000313a53ec670b87e15bbf87b (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.cpp12
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)