Scripts/Misc: Fix issues reported by static analysis

(cherry picked from commit 0e76d67e49)
This commit is contained in:
jackpoz
2016-01-23 17:42:37 +01:00
committed by Shauren
parent f783983004
commit f0bb02d8ee

View File

@@ -177,6 +177,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);
@@ -191,9 +194,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)
{