Files
4ab234f10c maploader / overmaps update - struct system, overmaps location bindings, misc backend improvements (#6403)
tl;dr level collections that can easily be logically restructured/moved
as necessary

will eventually be used for radio and overmaps location resolution.

this is the last part of
https://github.com/Citadel-Station-13/Citadel-Station-13-RP/pull/4841
that has not yet been integrated.
this will be a draft for a while.

---------

Co-authored-by: LetterN <24603524+LetterN@users.noreply.github.com>
2025-11-06 17:49:23 -08:00

40 lines
1.2 KiB
Plaintext

/**
* stuff that really just didn't fit anywhere
* unlike most "legacy" citrp files, things in here are allowed to be used and will be optimized & maintained.
*/
/**
* get all turfs of a given type or typecache on a zlevel
*/
/datum/controller/subsystem/mapping/proc/z_turfs_of_type(z, list/type_or_cache)
. = list()
if(ispath(type_or_cache))
for(var/turf/T as anything in block(locate(1, 1, z), locate(world.maxx, world.maxy, z)))
if(istype(T, type_or_cache))
. += T
else if(islist(type_or_cache))
for(var/turf/T as anything in block(locate(1, 1, z), locate(world.maxx, world.maxy, z)))
if(type_or_cache[T.type])
. += T
else
CRASH("What?")
/**
* throws things, i guess.
*/
/datum/controller/subsystem/mapping/proc/throw_movables_on_z_turfs_of_type(z, list/type_or_cache, dir)
ASSERT(dir in GLOB.cardinal)
var/list/throwing = list()
for(var/turf/T as anything in z_turfs_of_type(z, type_or_cache))
for(var/atom/movable/AM as anything in T)
if(AM.anchored)
continue
if((AM.atom_flags & ATOM_ABSTRACT))
continue
if(istype(AM, /obj/effect/decal))
qdel(AM)
continue
throwing += AM
for(var/atom/movable/AM as anything in throwing)
AM.throw_at_old(get_step(AM, dir), 5, 1)