Skip to content

Instantly share code, notes, and snippets.

@Sar777
Created September 14, 2017 19:43
Show Gist options
  • Save Sar777/b019b3e514d080ff6e67e8f58af816e5 to your computer and use it in GitHub Desktop.
Save Sar777/b019b3e514d080ff6e67e8f58af816e5 to your computer and use it in GitHub Desktop.
diff --git a/src/server/scripts/Northrend/Naxxramas/boss_patchwerk.cpp b/src/server/scripts/Northrend/Naxxramas/boss_patchwerk.cpp
index eeb5f7b..2bbdf42 100644
--- a/src/server/scripts/Northrend/Naxxramas/boss_patchwerk.cpp
+++ b/src/server/scripts/Northrend/Naxxramas/boss_patchwerk.cpp
@@ -127,16 +127,19 @@ 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;
- if ((!secondThreat || Is25ManRaid()) && (++it != end))
+ if ((!secondThreat || Is25ManRaid()) && (std::next(it) != end))
{
if ((*it)->GetVictim() != currentVictim)
- (secondThreat ? thirdThreat : secondThreat) = *it;
- if (!thirdThreat && Is25ManRaid() && (++it != end))
- thirdThreat = *it;
+ (secondThreat ? thirdThreat : secondThreat) = *(++it);
+ if (!thirdThreat && Is25ManRaid() && (std::next(it) != end))
+ thirdThreat = *(++it);
}
Unit* pHatefulTarget = nullptr;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment