Scripts/Misc: Fix issues reported by static analysis

This commit is contained in:
jackpoz committed 2016-01-23 17:42:37 +01:00
1 parent f5bd7b903c
commit 0e76d67e49
2 files changed
+4 -4

No files matched your search

+3 -3
View File
@@ -178,6 +178,9 @@ class npc_pet_mage_mirror_image : public CreatureScript
void UpdateAI(uint32 diff) override
{
Unit* owner = me->GetCharmerOrOwner();
if (!owner)
return;
Unit* target = owner->getAttackerForHelper();
events.Update(diff);
@@ -192,9 +195,6 @@ class npc_pet_mage_mirror_image : public CreatureScript
if (me->HasUnitState(UNIT_STATE_CASTING))
return;
if (!owner)
return;
// assign target if image doesnt have any or the target is not actual
if (!target || me->GetVictim() != target)
{