diff options
| author | jackpoz <giacomopoz@gmail.com> | 2014-03-27 21:43:59 +0100 |
|---|---|---|
| committer | jackpoz <giacomopoz@gmail.com> | 2014-03-27 21:43:59 +0100 |
| commit | 8c44259fae2980598980a7935a3f3941130a5a10 (patch) | |
| tree | 467b1561656e3e0d8b2e90d88b5db2953e7383ea /src/server/game/AI/SmartScripts | |
| parent | 30894c2badd08827c3bc8b57d8092d7226545e3b (diff) | |
Core/Misc: Fix some static analysis issues
Fix uninitialized values, most of which are false positives, always initialized before being accessed.
Add some asserts and additional NULL checks as sanity checks. Use SpellMgr::EnsureSpellInfo() if the spell id is valid and always supposed to return a valid not-NULL SpellInfo* .
Diffstat (limited to 'src/server/game/AI/SmartScripts')
| -rw-r--r-- | src/server/game/AI/SmartScripts/SmartScript.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/server/game/AI/SmartScripts/SmartScript.cpp b/src/server/game/AI/SmartScripts/SmartScript.cpp index 6d6b43f7d2e..231f3808aa9 100644 --- a/src/server/game/AI/SmartScripts/SmartScript.cpp +++ b/src/server/game/AI/SmartScripts/SmartScript.cpp @@ -512,7 +512,7 @@ void SmartScript::ProcessAction(SmartScriptHolder& e, Unit* unit, uint32 var0, u // unless target is outside spell range, out of mana, or LOS. bool _allowMove = false; - SpellInfo const* spellInfo = sSpellMgr->GetSpellInfo(e.action.cast.spell); + SpellInfo const* spellInfo = sSpellMgr->EnsureSpellInfo(e.action.cast.spell); int32 mana = me->GetPower(POWER_MANA); if (me->GetDistance(*itr) > spellInfo->GetMaxRange(true) || |
