mirror of
https://github.com/TrinityCore/TrinityCore.git
synced 2026-01-16 07:30:42 +01:00
Scripts/Patchwerk: Finally fix that crash for real. Closes #20247.
(cherry picked from commit 49daef4b77)
This commit is contained in:
@@ -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;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user