mirror of
https://github.com/TrinityCore/TrinityCore.git
synced 2026-01-24 10:56:38 +01:00
Scripts/Misc: Fix issues reported by static analysis
(cherry picked from commit 0e76d67e49)
This commit is contained in:
@@ -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)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user