Core/Misc: Fix some static analysis issues

Fix some static analysis issues about uninitialized values in scripts.
Add spell id validation in Unit::SpellNonMeleeDamageLog() .
This commit is contained in:
jackpoz committed 2013-12-08 22:04:30 +01:00
1 parent b76d141ce0
commit f418f4cf94
9 files changed
+10 -3

No files matched your search

+2
View File
@@ -957,6 +957,8 @@ void Unit::CastSpell(GameObject* go, uint32 spellId, bool triggered, Item* castI
uint32 Unit::SpellNonMeleeDamageLog(Unit* victim, uint32 spellID, uint32 damage)
{
SpellInfo const* spellInfo = sSpellMgr->GetSpellInfo(spellID);
if (!spellInfo)
return 0;
SpellNonMeleeDamage damageInfo(this, victim, spellInfo->Id, spellInfo->SchoolMask);
damage = SpellDamageBonusDone(victim, spellInfo, damage, SPELL_DIRECT_DAMAGE);
damage = victim->SpellDamageBonusTaken(this, spellInfo, damage, SPELL_DIRECT_DAMAGE);