Some ghostspawner fixes (#7403)

This commit is contained in:
fernerr
2019-11-13 23:17:23 +01:00
committed by Werner
parent 80fb3fa7ea
commit ada93c87f5
3 changed files with 49 additions and 6 deletions

View File

@@ -27,7 +27,7 @@
var/mob_name_pick_message = "Pick a name."
var/mob_name_prefix = null //The prefix that should be applied to the mob (i.e. CCIAA, Tpr., Cmdr.)
var/mob_name_suffix = null //The suffix that should be applied to the mob name
/datum/ghostspawner/New()
. = ..()
if(!jobban_job)
@@ -45,13 +45,13 @@
if(req_head_whitelist && !check_whitelist(user))
return "Missing Head of Staff Whitelist"
if(req_species_whitelist && !is_alien_whitelisted(user, req_species_whitelist))
return "Missing Species Whitelist"
if(jobban_job && jobban_isbanned(user,jobban_job))
return "Job Banned"
if(!enabled && !can_edit(user)) //If its not enabled and the user cant edit it, dont show it
return "Currently Disabled"
@@ -83,10 +83,10 @@
return FALSE
//Proc executed before someone is spawned in
/datum/ghostspawner/proc/pre_spawn(mob/user)
/datum/ghostspawner/proc/pre_spawn(mob/user)
count++ //Increment the spawned in mob count
if(max_count && count >= max_count)
disable()
enabled = FALSE
return TRUE
//This proc selects the spawnpoint to use.
@@ -114,6 +114,8 @@
//Proc executed after someone is spawned in
/datum/ghostspawner/proc/post_spawn(mob/user)
if(max_count && count >= max_count)
disable()
if(welcome_message)
to_chat(user, span("notice", welcome_message))
return TRUE

View File

@@ -64,7 +64,7 @@
var/picked_species = input(user,"Select your species") as null|anything in species_selection
if(!picked_species)
picked_species = "Human"
picked_species = possible_species[1]
//Get the name / age from them first
var/mname = get_mob_name(user, picked_species)