From 46c3f02ea98d02d0c72f794b58265da5a9c4eec8 Mon Sep 17 00:00:00 2001 From: jimmyl <70376633+mc-oofert@users.noreply.github.com> Date: Tue, 9 Apr 2024 06:16:55 +0200 Subject: [PATCH] [no gbp] you may no longer get nullspaced by deathmatch (#82502) ## About The Pull Request you may no longer start loading a map that is already being loaded by another lobby thats like a bad idea if you put some thought into the implications ## Why It's Good For The Game closes #82466 closes #82460 ## Changelog :cl: fix: deathmatch can no longer occassionally send people to nullspace /:cl: --- code/modules/deathmatch/deathmatch_lobby.dm | 9 ++++++++- code/modules/deathmatch/deathmatch_maps.dm | 3 +++ 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/code/modules/deathmatch/deathmatch_lobby.dm b/code/modules/deathmatch/deathmatch_lobby.dm index 5dfdba213ca..2afb3ff3a9a 100644 --- a/code/modules/deathmatch/deathmatch_lobby.dm +++ b/code/modules/deathmatch/deathmatch_lobby.dm @@ -47,6 +47,7 @@ clear_reservation() players = null observers = null + map?.template_in_use = FALSE //just incase map = null location = null loadouts = null @@ -55,13 +56,18 @@ /datum/deathmatch_lobby/proc/start_game() if (playing) return + if(map.template_in_use) + to_chat(get_mob_by_ckey(host), span_warning("This map is currently loading for another lobby. Please wait until that other map finishes loading. It would be a disaster if these two mixed up.")) + return playing = DEATHMATCH_PRE_PLAYING + map.template_in_use = TRUE RegisterSignal(map, COMSIG_LAZY_TEMPLATE_LOADED, PROC_REF(find_spawns_and_start_delay)) location = map.lazy_load() if (!location) to_chat(get_mob_by_ckey(host), span_warning("Couldn't reserve/load a map location (all locations used?), try again later, or contact a coder.")) playing = FALSE + map.template_in_use = FALSE UnregisterSignal(map, COMSIG_LAZY_TEMPLATE_LOADED) return FALSE @@ -72,6 +78,7 @@ player_spawns += thing UnregisterSignal(source, COMSIG_LAZY_TEMPLATE_LOADED) + map.template_in_use = FALSE addtimer(CALLBACK(src, PROC_REF(start_game_after_delay)), 8 SECONDS) /datum/deathmatch_lobby/proc/start_game_after_delay() @@ -202,7 +209,7 @@ announce(span_reallybig("[player.real_name] HAS DIED.
[players.len] REMAIN.")) - if(!gibbed && !QDELING(player)) // for some reason dusting or deleting in chasm storage messes up tgui bad + if(!gibbed && !QDELING(player)) if(!HAS_TRAIT(src, TRAIT_DEATHMATCH_EXPLOSIVE_IMPLANTS)) player.dust(TRUE, TRUE, TRUE) if (players.len <= 1) diff --git a/code/modules/deathmatch/deathmatch_maps.dm b/code/modules/deathmatch/deathmatch_maps.dm index e594ab24fcb..ebc3328e0ca 100644 --- a/code/modules/deathmatch/deathmatch_maps.dm +++ b/code/modules/deathmatch/deathmatch_maps.dm @@ -13,6 +13,9 @@ var/automatic_gameend_time = 8 MINUTES /// List of allowed loadouts for this map, otherwise defaults to all loadouts var/list/allowed_loadouts = list() + /// whether we are currently being loaded by a lobby + var/template_in_use = FALSE + /datum/lazy_template/deathmatch/ragecage name = "Ragecage"