From af2d5e3fd4a57147280d265d1bc5ac1c2b70a3a3 Mon Sep 17 00:00:00 2001 From: megamage Date: Thu, 30 Jul 2009 11:37:08 +0800 Subject: [8250] Cleanup code and data for `spell_threat` Author: nos4r2zod * Load table data to std::map instead SQLStorage and add check loaded spell existance. * Drop from table not existed spells. --HG-- branch : trunk --- src/game/Spell.cpp | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) (limited to 'src/game/Spell.cpp') diff --git a/src/game/Spell.cpp b/src/game/Spell.cpp index f4e992b6a7b..5c1b2fc3687 100644 --- a/src/game/Spell.cpp +++ b/src/game/Spell.cpp @@ -4200,13 +4200,14 @@ void Spell::HandleThreatSpells(uint32 spellId) if(!m_targets.getUnitTarget()->CanHaveThreatList()) return; - SpellThreatEntry const *threatSpell = sSpellThreatStore.LookupEntry(spellId); - if(!threatSpell) + uint16 threat = spellmgr.GetSpellThreat(spellId); + + if(!threat) return; - m_targets.getUnitTarget()->AddThreat(m_caster, float(threatSpell->threat)); + m_targets.getUnitTarget()->AddThreat(m_caster, float(threat)); - DEBUG_LOG("Spell %u, rank %u, added an additional %i threat", spellId, spellmgr.GetSpellRank(spellId), threatSpell->threat); + DEBUG_LOG("Spell %u, rank %u, added an additional %i threat", spellId, spellmgr.GetSpellRank(spellId), threat); } void Spell::HandleEffects(Unit *pUnitTarget,Item *pItemTarget,GameObject *pGOTarget,uint32 i) -- cgit v1.2.3