fix(Core): Fixed a few crashes/bugs that were found via static code analysis (#2617)

This commit is contained in:
Kaev
2020-01-25 14:26:38 +01:00
committed by Stoabrogga
parent 1bbe10dc33
commit 999d588c37
21 changed files with 80 additions and 59 deletions

View File

@@ -551,11 +551,14 @@ class boss_essence_of_anger : public CreatureScript
events.ScheduleEvent(EVENT_ANGER_SOUL_SCREAM, 10000);
break;
case EVENT_ANGER_SEETHE:
if (targetGUID && targetGUID != me->GetVictim()->GetGUID())
me->CastSpell(me, SPELL_SEETHE, false);
// victim can be lost
if (me->GetVictim())
targetGUID = me->GetVictim()->GetGUID();
if (Unit* victim = me->GetVictim())
{
uint64 victimGUID = victim->GetGUID();
if (targetGUID && targetGUID != victimGUID)
me->CastSpell(me, SPELL_SEETHE, false);
// victim can be lost
targetGUID = victimGUID;
}
events.ScheduleEvent(EVENT_ANGER_SEETHE, 1000);
break;