From 98b5f41770de6bc13deb010a17122498c39d1d7e Mon Sep 17 00:00:00 2001 From: Fayrik Date: Tue, 7 Apr 2015 21:48:00 +0100 Subject: [PATCH] As you can see, I'm an idiot that codes potential infinite loops. (But I also fix it too.) --- code/modules/admin/verbs/one_click_antag.dm | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/code/modules/admin/verbs/one_click_antag.dm b/code/modules/admin/verbs/one_click_antag.dm index b8041bc269e..be22d3a4e25 100644 --- a/code/modules/admin/verbs/one_click_antag.dm +++ b/code/modules/admin/verbs/one_click_antag.dm @@ -355,6 +355,7 @@ client/proc/one_click_antag() var/list/spawnpoints = deathsquadspawn while(numagents && candidates.len) if (numagents > spawnpoints.len) + numagents-- continue // This guy's unlucky, not enough spawn points, we skip him. var/spawnloc = spawnpoints[numagents] var/mob/dead/observer/chosen_candidate = pick(candidates) @@ -469,7 +470,8 @@ client/proc/one_click_antag() var/numagents = min(7,candidates.len) //How many officers to spawn var/list/spawnpoints = emergencyresponseteamspawn while(numagents && candidates.len) - if (candidates.len > spawnpoints.len) + if (numagents > spawnpoints.len) + numagents-- continue // This guy's unlucky, not enough spawn points, we skip him. var/spawnloc = spawnpoints[numagents] var/mob/dead/observer/chosen_candidate = pick(candidates)