Fixed some possible runtimes with pollCandidates() (#19919)

* Fixed some possible runtimes with pollCandidates()

* Fixed bug in pollCandidatesForMobs()
This commit is contained in:
Cruix
2016-08-22 08:45:22 +12:00
committed by oranges
parent c3da691c16
commit f406e518cc
7 changed files with 23 additions and 7 deletions
+1 -1
View File
@@ -166,7 +166,7 @@
blobber.notransform = 1 //stop the naut from moving around
blobber.adjustHealth(blobber.maxHealth * 0.5)
blob_mobs += blobber
var/list/mob/dead/observer/candidates = pollCandidates("Do you want to play as a [blob_reagent_datum.name] blobbernaut?", ROLE_BLOB, null, ROLE_BLOB, 50) //players must answer rapidly
var/list/mob/dead/observer/candidates = pollCandidatesForMob("Do you want to play as a [blob_reagent_datum.name] blobbernaut?", ROLE_BLOB, null, ROLE_BLOB, 50, blobber) //players must answer rapidly
if(candidates.len) //if we got at least one candidate, they're a blobbernaut now.
var/client/C = pick(candidates)
blobber.notransform = 0
+1 -1
View File
@@ -517,7 +517,7 @@
return max(0, enemy_minimum_age - C.player_age)
/datum/game_mode/proc/replace_jobbaned_player(mob/living/M, role_type, pref)
var/list/mob/dead/observer/candidates = pollCandidates("Do you want to play as a [role_type]?", "[role_type]", null, pref, 100)
var/list/mob/dead/observer/candidates = pollCandidatesForMob("Do you want to play as a [role_type]?", "[role_type]", null, pref, 100, M)
var/mob/dead/observer/theghost = null
if(candidates.len)
theghost = pick(candidates)