Merge pull request #14959 from Citadel-Station-13/table-floodfills

rewrites subtler_around_table to be slightly cleaner and (probably) work?
This commit is contained in:
Lin
2021-07-25 13:56:35 -07:00
committed by GitHub
2 changed files with 33 additions and 26 deletions
@@ -243,6 +243,32 @@
new framestack(T, framestackamount)
qdel(src)
/**
* Gets all connected tables
* Cardinals only
*/
/obj/structure/table/proc/connected_floodfill(max = 25)
. = list()
connected_floodfill_internal(., list())
/obj/structure/table/proc/connected_floodfill_internal(list/out = list(), list/processed = list())
if(processed[src])
return
processed[src] = TRUE
out += src
var/obj/structure/table/other
#define RUN_TABLE(dir) \
other = locate(/obj/structure/table) in get_step(src, dir); \
if(other) { \
other.connected_floodfill_internal(out, processed); \
}
RUN_TABLE(NORTH)
RUN_TABLE(SOUTH)
RUN_TABLE(EAST)
RUN_TABLE(WEST)
#undef RUN_TABLE
/obj/structure/table/greyscale
icon = 'icons/obj/smooth_structures/table_greyscale.dmi'
icon_state = "table"