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

24 lines
684 B
Plaintext

GLOBAL_LIST_EMPTY(connected_z_cache)
// todo: legacy code
/proc/GetConnectedZlevels(z)
return SSmapping.level_get_stack(z)
// todo: legacy code
/proc/AreConnectedZLevels(zA, zB)
if (zA <= 0 || zB <= 0 || zA > world.maxz || zB > world.maxz)
return FALSE
if (zA == zB)
return TRUE
if (length(GLOB.connected_z_cache) >= zA && length(GLOB.connected_z_cache[zA]) >= zB)
return GLOB.connected_z_cache[zA][zB]
var/list/levels = GetConnectedZlevels(zA)
var/list/new_entry = new(world.maxz)
for (var/entry in levels)
new_entry[entry] = TRUE
if (GLOB.connected_z_cache.len < zA)
GLOB.connected_z_cache.len = zA
GLOB.connected_z_cache[zA] = new_entry
return new_entry[zB]