mirror of
https://github.com/CHOMPStation2/CHOMPStation2.git
synced 2025-12-29 03:22:12 +00:00
Merge pull request #11602 from VOREStation/upstream-merge-8297
[MIRROR] Adds sanity check to overmap temp Z level can_die()
This commit is contained in:
committed by
Chompstation Bot
parent
cfad19ad15
commit
9731e1a758
@@ -5,7 +5,8 @@
|
|||||||
known = FALSE
|
known = FALSE
|
||||||
in_space = TRUE
|
in_space = TRUE
|
||||||
|
|
||||||
/obj/effect/overmap/visitable/sector/temporary/New(var/nx, var/ny)
|
/obj/effect/overmap/visitable/sector/temporary/Initialize(var/nx, var/ny)
|
||||||
|
. = ..()
|
||||||
loc = locate(nx, ny, global.using_map.overmap_z)
|
loc = locate(nx, ny, global.using_map.overmap_z)
|
||||||
x = nx
|
x = nx
|
||||||
y = ny
|
y = ny
|
||||||
@@ -20,16 +21,19 @@
|
|||||||
testing("Temporary sector at [x],[y] was destroyed, returning empty zlevel [map_z[1]] to map datum.")
|
testing("Temporary sector at [x],[y] was destroyed, returning empty zlevel [map_z[1]] to map datum.")
|
||||||
return ..()
|
return ..()
|
||||||
|
|
||||||
/obj/effect/overmap/visitable/sector/temporary/proc/can_die(var/mob/observer)
|
/obj/effect/overmap/visitable/sector/temporary/proc/is_empty(var/mob/observer)
|
||||||
testing("Checking if sector at [map_z[1]] can die.")
|
if(!LAZYLEN(map_z))
|
||||||
|
log_and_message_admins("CANARY: [src] tried to check is_empty, but map_z is `[map_z || "null"]`")
|
||||||
|
return TRUE
|
||||||
|
testing("Checking if sector at [map_z[1]] has no players.")
|
||||||
for(var/mob/M in global.player_list)
|
for(var/mob/M in global.player_list)
|
||||||
if(M != observer && (M.z in map_z))
|
if(M != observer && (M.z in map_z))
|
||||||
testing("There are people on it.")
|
testing("There are people on it.")
|
||||||
return 0
|
return FALSE
|
||||||
return 1
|
return TRUE
|
||||||
|
|
||||||
/obj/effect/overmap/visitable/sector/temporary/cleanup()
|
/obj/effect/overmap/visitable/sector/temporary/cleanup()
|
||||||
if(can_die())
|
if(is_empty())
|
||||||
qdel(src)
|
qdel(src)
|
||||||
|
|
||||||
/proc/get_deepspace(x,y)
|
/proc/get_deepspace(x,y)
|
||||||
|
|||||||
Reference in New Issue
Block a user