Merge pull request #4928 from VOREStation/pol-join-order

Create humans ON their spawn points
This commit is contained in:
Anewbe
2018-02-23 13:18:28 -06:00
committed by GitHub
2 changed files with 30 additions and 25 deletions
+15 -17
View File
@@ -607,32 +607,30 @@ var/global/datum/controller/occupations/job_master
tmp_str += "HIGH=[level1]|MEDIUM=[level2]|LOW=[level3]|NEVER=[level4]|BANNED=[level5]|YOUNG=[level6]|-"
feedback_add_details("job_preferences",tmp_str)
/datum/controller/occupations/proc/LateSpawn(var/mob/living/carbon/human/H, var/rank)
//spawn at one of the latespawn locations
/datum/controller/occupations/proc/LateSpawn(var/client/C, var/rank)
var/datum/spawnpoint/spawnpos
// if(H.client.prefs.spawnpoint)
// spawnpos = spawntypes[H.client.prefs.spawnpoint]
if(H.client.prefs.spawnpoint)
if(!(H.client.prefs.spawnpoint in using_map.allowed_spawns))
if(H) // This seems redundant...
to_chat(H, "<span class='warning'>Your chosen spawnpoint ([H.client.prefs.spawnpoint]) is unavailable for the current map. Spawning you at one of the enabled spawn points instead.</span>")
//Spawn them at their preferred one
if(C.prefs.spawnpoint)
if(!(C.prefs.spawnpoint in using_map.allowed_spawns))
to_chat(C, "<span class='warning'>Your chosen spawnpoint ([C.prefs.spawnpoint]) is unavailable for the current map. Spawning you at one of the enabled spawn points instead.</span>")
spawnpos = null
else
spawnpos = spawntypes[H.client.prefs.spawnpoint]
spawnpos = spawntypes[C.prefs.spawnpoint]
//We will return a list key'd by "turf" and "msg"
. = list("turf","msg")
if(spawnpos && istype(spawnpos) && spawnpos.turfs.len)
if(spawnpos.check_job_spawning(rank))
H.forceMove(spawnpos.get_spawn_position())
. = spawnpos.msg
.["turf"] = spawnpos.get_spawn_position()
.["msg"] = spawnpos.msg
else
H << "Your chosen spawnpoint ([spawnpos.display_name]) is unavailable for your chosen job. Spawning you at the Arrivals shuttle instead."
to_chat(C,"Your chosen spawnpoint ([spawnpos.display_name]) is unavailable for your chosen job. Spawning you at the Arrivals shuttle instead.")
var/spawning = pick(latejoin)
H.forceMove(get_turf(spawning))
. = "will arrive to the station shortly by shuttle"
.["turf"] = get_turf(spawning)
.["msg"] = "will arrive to the station shortly by shuttle"
else
var/spawning = pick(latejoin)
H.forceMove(get_turf(spawning))
. = "has arrived on the station"
.["turf"] = get_turf(spawning)
.["msg"] = "has arrived on the station"
+15 -8
View File
@@ -326,13 +326,23 @@
if(!IsJobAvailable(rank))
src << alert("[rank] is not available. Please try another.")
return 0
if(!client)
return 0
//Find our spawning point.
var/list/join_props = job_master.LateSpawn(client, rank)
var/turf/T = join_props["turf"]
var/join_message = join_props["msg"]
if(!T || !join_message)
return 0
spawning = 1
close_spawn_windows()
job_master.AssignRole(src, rank, 1)
var/mob/living/character = create_character() //creates the human and transfers vars and mind
var/mob/living/character = create_character(T) //creates the human and transfers vars and mind
character = job_master.EquipRank(character, rank, 1) //equips the human
UpdateFactionList(character)
@@ -354,14 +364,11 @@
qdel(src)
return
//Find our spawning point.
var/join_message = job_master.LateSpawn(character, rank)
// Equip our custom items only AFTER deploying to spawn points eh?
equip_custom_items(character)
character.apply_traits()
character.lastarea = get_area(loc)
// Moving wheelchair if they have one
if(character.buckled && istype(character.buckled, /obj/structure/bed/chair/wheelchair))
character.buckled.loc = character.loc
@@ -419,7 +426,7 @@
src << browse(dat, "window=latechoices;size=300x640;can_close=1")
/mob/new_player/proc/create_character()
/mob/new_player/proc/create_character(var/turf/T)
spawning = 1
close_spawn_windows()
@@ -434,12 +441,12 @@
if(chosen_species && use_species_name)
// Have to recheck admin due to no usr at roundstart. Latejoins are fine though.
if(is_alien_whitelisted(chosen_species))
new_character = new(loc, use_species_name)
new_character = new(T, use_species_name)
if(!new_character)
new_character = new(loc)
new_character = new(T)
new_character.lastarea = get_area(loc)
new_character.lastarea = get_area(T)
if(ticker.random_players)
new_character.gender = pick(MALE, FEMALE)