Hole and Hole-Adjacent Changes (#15345)

This commit is contained in:
Geeves
2022-12-20 17:05:43 +01:00
committed by GitHub
parent 6719b17b3b
commit b4c4cf69ec
14 changed files with 127 additions and 99 deletions
+2 -2
View File
@@ -52,11 +52,11 @@
var/turf/start = get_turf(src)
if(!start.CanZPass(src, direction))
to_chat(src, SPAN_WARNING("\The [start] is in the way."))
to_chat(src, SPAN_WARNING("\The [start.GetZPassBlocker()] is in the way."))
return FALSE
if(!destination.CanZPass(src, direction))
to_chat(src, SPAN_WARNING("\The [destination] is in the way!"))
to_chat(src, SPAN_WARNING("\The [destination.GetZPassBlocker()] is in the way!"))
return FALSE
var/area/area = get_area(src)
+3 -3
View File
@@ -158,10 +158,10 @@
if(istype(target_ladder, target_down))
direction = DOWN
if(!LAD.CanZPass(M, direction))
to_chat(M, "<span class='notice'>\The [LAD] is blocking \the [src].</span>")
to_chat(M, "<span class='notice'>\The [LAD.GetZPassBlocker()] is blocking \the [src].</span>")
return FALSE
if(!T.CanZPass(M, direction))
to_chat(M, "<span class='notice'>\The [T] is blocking \the [src].</span>")
to_chat(M, "<span class='notice'>\The [T.GetZPassBlocker()] is blocking \the [src].</span>")
return FALSE
for(var/atom/A in T)
if(!isliving(A))
@@ -286,4 +286,4 @@
/obj/structure/stairs/west
dir = WEST
bound_width = 64
bound_width = 64
+18 -3
View File
@@ -39,15 +39,24 @@
if(direction == DOWN) //on a turf above, trying to enter
return !density
/turf/proc/GetZPassBlocker()
return src
/turf/simulated/open/CanZPass(atom/A, direction)
if(locate(/obj/structure/lattice/catwalk, src))
if(z == A.z)
if(direction == DOWN)
return 0
return FALSE
else if(direction == UP)
return 0
return FALSE
return 1
/turf/simulated/open/GetZPassBlocker()
var/obj/structure/lattice/catwalk/catwalk = locate(/obj/structure/lattice/catwalk, src)
if(catwalk)
return catwalk
return src
/turf/space/CanZPass(atom/A, direction)
if(locate(/obj/structure/lattice/catwalk, src))
if(z == A.z)
@@ -57,6 +66,12 @@
return 0
return 1
/turf/space/GetZPassBlocker()
var/obj/structure/lattice/catwalk/catwalk = locate(/obj/structure/lattice/catwalk, src)
if(catwalk)
return catwalk
return src
// Add a falling atom by default. Even if it's not an atom that can actually fall.
// SSfalling will check this on its own and remove if necessary. This is saner, as it
@@ -256,4 +271,4 @@
return t.roof_type
/turf/simulated/open/is_open()
return TRUE
return TRUE