Added the z-level manager system from TG (#19532)

Added the z-level manager system from TG, mostly
This commit is contained in:
Fluffy
2024-07-22 13:00:38 +00:00
committed by GitHub
parent 0a9176841c
commit 1345beac4b
90 changed files with 614 additions and 245 deletions
+5 -3
View File
@@ -34,7 +34,8 @@
. = ..()
// the upper will connect to the lower
if(allowed_directions & DOWN) //we only want to do the top one, as it will initialize the ones before it.
for(var/obj/structure/ladder/L in GetBelow(src))
var/turf/T = get_turf(src)
for(var/obj/structure/ladder/L in GET_TURF_BELOW(T))
if(L.allowed_directions & UP)
target_down = L
L.target_up = src
@@ -237,7 +238,7 @@
/obj/structure/stairs/Initialize()
. = ..()
for(var/turf/turf in locs)
var/turf/simulated/open/above = GetAbove(turf)
var/turf/simulated/open/above = GET_TURF_ABOVE(turf)
if(!above)
log_asset("Stair created without z-level above: ([loc.x], [loc.y], [loc.z])")
return INITIALIZE_HINT_QDEL
@@ -264,7 +265,8 @@
var/atom/movable/AM = bumped_atom
// This is hackish but whatever.
var/turf/target = get_step(GetAbove(AM), dir)
var/turf/T = get_turf(AM)
var/turf/target = get_step(GET_TURF_ABOVE(T), dir)
if(!target)
return
if(target.z > (z + 1)) //Prevents wheelchair fuckery. Basically, you teleport twice because both the wheelchair + your mob collide with the stairs.