Scripts/Patchwerk: Finally fix that crash for real. Closes #20247.

(cherry picked from commit 49daef4b77)
This commit is contained in:
Treeston
2017-09-15 00:22:18 +02:00
committed by Shauren
parent 6210fc10ae
commit 77d13a7b97

View File

@@ -127,7 +127,10 @@ public:
auto list = mgr.GetModifiableThreatList();
auto it = list.begin(), end = list.end();
if (it == end)
{
EnterEvadeMode(EVADE_REASON_NO_HOSTILES);
return;
}
if ((*it)->GetVictim() != currentVictim)
secondThreat = *it;
@@ -147,8 +150,6 @@ public:
else
pHatefulTarget = (secondThreat->GetVictim()->GetHealth() < thirdThreat->GetVictim()->GetHealth()) ? thirdThreat->GetVictim() : secondThreat->GetVictim();
DoCast(pHatefulTarget, SPELL_HATEFUL_STRIKE, true);
// add threat to highest threat targets
AddThreat(currentVictim, HATEFUL_THREAT_AMT);
if (secondThreat)
@@ -156,6 +157,8 @@ public:
if (thirdThreat)
thirdThreat->AddThreat(HATEFUL_THREAT_AMT);
DoCast(pHatefulTarget, SPELL_HATEFUL_STRIKE, true);
events.Repeat(Seconds(1));
break;
}