From fe2abc990b1d4b239348dfc7026fc266335fb987 Mon Sep 17 00:00:00 2001 From: Ghommie Date: Sat, 6 Jul 2019 04:51:56 +0200 Subject: [PATCH] Fixes new player runtime that makes people unable to join rounds. --- .../antagonists/clockcult/clock_items/construct_chassis.dm | 5 +++-- code/modules/awaymissions/corpse.dm | 4 ++-- code/modules/mob/dead/new_player/new_player.dm | 4 ++++ 3 files changed, 9 insertions(+), 4 deletions(-) diff --git a/code/modules/antagonists/clockcult/clock_items/construct_chassis.dm b/code/modules/antagonists/clockcult/clock_items/construct_chassis.dm index 30c84f5312..12af249bee 100644 --- a/code/modules/antagonists/clockcult/clock_items/construct_chassis.dm +++ b/code/modules/antagonists/clockcult/clock_items/construct_chassis.dm @@ -21,8 +21,9 @@ /obj/item/clockwork/construct_chassis/Destroy() GLOB.poi_list -= src - var/list/spawners = GLOB.mob_spawners[name] - LAZYREMOVE(spawners, src) + LAZYREMOVE(GLOB.mob_spawners[name], src) + if(!LAZYLEN(GLOB.mob_spawners[name])) + GLOB.mob_spawners -= name . = ..() /obj/item/clockwork/construct_chassis/examine(mob/user) diff --git a/code/modules/awaymissions/corpse.dm b/code/modules/awaymissions/corpse.dm index 07cc5c8225..74f81ec9a0 100644 --- a/code/modules/awaymissions/corpse.dm +++ b/code/modules/awaymissions/corpse.dm @@ -72,9 +72,9 @@ /obj/effect/mob_spawn/Destroy() GLOB.poi_list -= src var/job_name = job_description ? job_description : name - GLOB.mob_spawners -= job_name + LAZYREMOVE(GLOB.mob_spawners[job_name], src) if(!LAZYLEN(GLOB.mob_spawners[job_name])) - LAZYREMOVE(GLOB.mob_spawners[job_name], src) + GLOB.mob_spawners -= job_name return ..() /obj/effect/mob_spawn/proc/can_latejoin() //If it can be taken from the lobby. diff --git a/code/modules/mob/dead/new_player/new_player.dm b/code/modules/mob/dead/new_player/new_player.dm index 315ffff7c7..0d72d47023 100644 --- a/code/modules/mob/dead/new_player/new_player.dm +++ b/code/modules/mob/dead/new_player/new_player.dm @@ -444,6 +444,8 @@ if(job && IsJobUnavailable(job.title, TRUE) == JOB_AVAILABLE) available_job_count++ for(var/spawner in GLOB.mob_spawners) + if(!LAZYLEN(spawner)) + continue var/obj/effect/mob_spawn/S = pick(GLOB.mob_spawners[spawner]) if(!istype(S) || !S.can_latejoin()) continue @@ -468,6 +470,8 @@ "Security" = list(jobs = list(), titles = GLOB.security_positions, color = "#ff9999"), ) for(var/spawner in GLOB.mob_spawners) + if(!LAZYLEN(spawner)) + continue var/obj/effect/mob_spawn/S = pick(GLOB.mob_spawners[spawner]) if(!istype(S) || !S.can_latejoin()) continue