Core/Misc: Fix some static analysis issues

Add some asserts and additional NULL checks as sanity checks.
This commit is contained in:
jackpoz
2014-03-21 22:47:58 +01:00
parent ada0598bb0
commit 9e99db035f
11 changed files with 47 additions and 23 deletions

View File

@@ -250,8 +250,9 @@ public:
target->CastSpell(target, SPELL_SNAKE_WRAP, true);
if (TempSummon* _me = me->ToTempSummon())
if (Creature* sladran = _me->GetSummoner()->ToCreature())
sladran->AI()->SetGUID(target->GetGUID(), DATA_SNAKES_WHYD_IT_HAVE_TO_BE_SNAKES);
if (Unit* summoner = _me->GetSummoner())
if (Creature* sladran = summoner->ToCreature())
sladran->AI()->SetGUID(target->GetGUID(), DATA_SNAKES_WHYD_IT_HAVE_TO_BE_SNAKES);
me->DespawnOrUnsummon();
}