Scripts/Naxxramas: Missing nullptr check in Patchwerk. Closes #20247.

This commit is contained in:
Treeston
2017-09-06 18:26:31 +02:00
parent a1a12ec755
commit c9ac68d6e3

View File

@@ -140,14 +140,13 @@ public:
}
Unit* pHatefulTarget = nullptr;
if (!thirdThreat)
if (!secondThreat)
pHatefulTarget = currentVictim;
else if (!thirdThreat)
pHatefulTarget = secondThreat->GetVictim();
else if (secondThreat)
else
pHatefulTarget = (secondThreat->GetVictim()->GetHealth() < thirdThreat->GetVictim()->GetHealth()) ? thirdThreat->GetVictim() : secondThreat->GetVictim();
if (!pHatefulTarget)
pHatefulTarget = me->GetVictim();
DoCast(pHatefulTarget, SPELL_HATEFUL_STRIKE, true);
// add threat to highest threat targets