Skip to content

Commit

Permalink
[MIRROR] [no gbp] you may no longer get nullspaced by deathmatch (#1879)
Browse files Browse the repository at this point in the history
* [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:

* [no gbp] you may no longer get nullspaced by deathmatch

---------

Co-authored-by: jimmyl <[email protected]>
  • Loading branch information
2 people authored and StealsThePRs committed Apr 9, 2024
1 parent 002019a commit 39c0a02
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 1 deletion.
9 changes: 8 additions & 1 deletion code/modules/deathmatch/deathmatch_lobby.dm
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@
clear_reservation()
players = null
observers = null
map?.template_in_use = FALSE //just incase
map = null
location = null
loadouts = null
Expand All @@ -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

Expand All @@ -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()
Expand Down Expand Up @@ -207,7 +214,7 @@

announce(span_reallybig("[player.real_name] HAS DIED.<br>[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)
Expand Down
3 changes: 3 additions & 0 deletions code/modules/deathmatch/deathmatch_maps.dm
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down

0 comments on commit 39c0a02

Please sign in to comment.