Scripts/Naxxramas: Fix an edge case crash with people teleporting out of the dungeon during the Patchwerk encounter (tagging #20247)

(cherry picked from commit 50e8de103b65be3addb1f0fefb4ed4bf13d5a30a)
This commit is contained in:
Treeston
2020-08-29 00:14:50 +02:00
committed by Shauren
parent 1108164f1b
commit bece27ef3f
@@ -131,11 +131,11 @@ public:
if ((*it)->GetVictim() != currentVictim)
secondThreat = *it;
if ((!secondThreat || Is25ManRaid()) && (++it != end))
if ((!secondThreat || Is25ManRaid()) && (++it != end && (*it)->IsAvailable()))
{
if ((*it)->GetVictim() != currentVictim)
(secondThreat ? thirdThreat : secondThreat) = *it;
if (!thirdThreat && Is25ManRaid() && (++it != end))
if (!thirdThreat && Is25ManRaid() && (++it != end && (*it)->IsAvailable()))
thirdThreat = *it;
}