mirror of
https://github.com/Bubberstation/Bubberstation.git
synced 2025-12-14 11:42:27 +00:00
* Multiz Rework: Human Suffering Edition (Contains PLANE CUBE) * skyrat changes * bodyparts merge * unres door floorlight fix * Future upstream fix for blindness * upcoming upstream airlock fix * fix button emissive * Fix FOV markings? Co-authored-by: LemonInTheDark <58055496+LemonInTheDark@users.noreply.github.com> Co-authored-by: tastyfish <crazychris32@gmail.com>
52 lines
1.1 KiB
Plaintext
52 lines
1.1 KiB
Plaintext
/proc/get_step_multiz(ref, dir)
|
|
if(dir & UP)
|
|
dir &= ~UP
|
|
return get_step(SSmapping.get_turf_above(get_turf(ref)), dir)
|
|
if(dir & DOWN)
|
|
dir &= ~DOWN
|
|
return get_step(SSmapping.get_turf_below(get_turf(ref)), dir)
|
|
return get_step(ref, dir)
|
|
|
|
/proc/get_dir_multiz(turf/us, turf/them)
|
|
us = get_turf(us)
|
|
them = get_turf(them)
|
|
if(!us || !them)
|
|
return NONE
|
|
if(us.z == them.z)
|
|
return get_dir(us, them)
|
|
else
|
|
var/turf/T = us.above()
|
|
var/dir = NONE
|
|
if(T && (T.z == them.z))
|
|
dir = UP
|
|
else
|
|
T = us.below()
|
|
if(T && (T.z == them.z))
|
|
dir = DOWN
|
|
else
|
|
return get_dir(us, them)
|
|
return (dir | get_dir(us, them))
|
|
|
|
/turf/proc/above()
|
|
return get_step_multiz(src, UP)
|
|
|
|
/turf/proc/below()
|
|
return get_step_multiz(src, DOWN)
|
|
|
|
/proc/get_lowest_turf(atom/ref)
|
|
var/turf/us = get_turf(ref)
|
|
var/next = SSmapping.get_turf_below(us)
|
|
while(next)
|
|
us = next
|
|
next = SSmapping.get_turf_below(us)
|
|
return us
|
|
|
|
// I wish this was lisp
|
|
/proc/get_highest_turf(atom/ref)
|
|
var/turf/us = get_turf(ref)
|
|
var/next = SSmapping.get_turf_above(us)
|
|
while(next)
|
|
us = next
|
|
next = SSmapping.get_turf_above(us)
|
|
return us
|