From cd0428f4bba54ef6498e1d79b2188abb3410ec0f Mon Sep 17 00:00:00 2001 From: "VivianFoxfoot@gmail.com" Date: Thu, 15 Mar 2012 22:31:23 +0000 Subject: [PATCH] Fixes a bug where the tensioner spawning players would fail in less than ideal conditions. git-svn-id: http://tgstation13.googlecode.com/svn/trunk@3303 316c924e-a436-60f5-8080-3fe189b3f50e --- code/datums/helper_datums/tension.dm | 22 +++++++++++++++++++--- code/datums/mind.dm | 7 ++++++- 2 files changed, 25 insertions(+), 4 deletions(-) diff --git a/code/datums/helper_datums/tension.dm b/code/datums/helper_datums/tension.dm index 8cbb625c43e..3d8312b50cc 100644 --- a/code/datums/helper_datums/tension.dm +++ b/code/datums/helper_datums/tension.dm @@ -356,8 +356,13 @@ var/global/datum/tension/tension_master spawn(300) if(candidates.len) - theghost = pick(candidates) + while(!theghost && candidates.len) + theghost = pick(candidates) + candidates.Remove(theghost) + if(!theghost) + return 0 var/mob/living/carbon/human/new_character=makeBody(theghost) + del(theghost) new_character.mind.make_Wizard() @@ -420,8 +425,13 @@ var/global/datum/tension/tension_master syndicate_begin() for(var/i = 0, i