From 9a9fd29e0486309e96d50b78b2aa5cabe585fa3f Mon Sep 17 00:00:00 2001 From: Cyberboss Date: Sun, 12 Mar 2017 18:35:41 -0400 Subject: [PATCH] Cleans some stuff up concerning the new latejoin spawns (#24948) * Fixes mobs picking from an empty loc list * Fixes latejoin chairs failing to GC * More robust arrival shuttle latejoin warnings --- .../objects/structures/beds_chairs/chair.dm | 4 ++++ code/modules/mob/new_player/new_player.dm | 5 +++-- code/modules/shuttle/arrivals.dm | 18 +++++++++++++----- 3 files changed, 20 insertions(+), 7 deletions(-) diff --git a/code/game/objects/structures/beds_chairs/chair.dm b/code/game/objects/structures/beds_chairs/chair.dm index 264c1923b56..796994f6848 100644 --- a/code/game/objects/structures/beds_chairs/chair.dm +++ b/code/game/objects/structures/beds_chairs/chair.dm @@ -15,6 +15,10 @@ var/item_chair = /obj/item/chair // if null it can't be picked up layer = OBJ_LAYER +/obj/structure/chair/Destroy() + latejoin -= src //These may be here due to the arrivals shuttle + return ..() + /obj/structure/chair/deconstruct() // If we have materials, and don't have the NOCONSTRUCT flag if(buildstacktype && (!(flags & NODECONSTRUCT))) diff --git a/code/modules/mob/new_player/new_player.dm b/code/modules/mob/new_player/new_player.dm index 38f6e4f5dae..6301f00c1b8 100644 --- a/code/modules/mob/new_player/new_player.dm +++ b/code/modules/mob/new_player/new_player.dm @@ -318,8 +318,9 @@ if(isliving(equip)) //Borgs get borged in the equip, so we need to make sure we handle the new mob. character = equip - - var/D = get_turf(pick(latejoin)) + var/D + if(latejoin.len) + D = get_turf(pick(latejoin)) if(!D) for(var/turf/T in get_area_turfs(/area/shuttle/arrival)) if(!T.density) diff --git a/code/modules/shuttle/arrivals.dm b/code/modules/shuttle/arrivals.dm index f0b77700fbf..5ce3af29e88 100644 --- a/code/modules/shuttle/arrivals.dm +++ b/code/modules/shuttle/arrivals.dm @@ -37,17 +37,25 @@ areas = list() - if(latejoin.len) - WARNING("Map contains predefined latejoin spawn points and an arrivals shuttle. Using the arrivals shuttle.") - - latejoin = list() + var/list/new_latejoin = list() for(var/area/shuttle/arrival/A in sortedAreas) for(var/obj/structure/chair/C in A) - latejoin += C + new_latejoin += C if(!console) console = locate(/obj/machinery/requests_console) in A areas += A + if(latejoin.len) + WARNING("Map contains predefined latejoin spawn points and an arrivals shuttle. Using the arrivals shuttle.") + + if(!new_latejoin.len) + WARNING("Arrivals shuttle contains no chairs for spawn points. Reverting to latejoin landmarks.") + if(!latejoin.len) + WARNING("No latejoin landmarks exist. Players will spawn unbuckled on the shuttle.") + return + + latejoin = new_latejoin + /obj/docking_port/mobile/arrivals/dockRoundstart() SSshuttle.generate_transit_dock(src) Launch()