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:
1 parent
b76d141ce0
commit
f418f4cf94
9 files changed
+10
-3
No files matched your search
@@ -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);
|
||||
|
||||
Reference in new issue
Block a user