mirror of
https://github.com/Citadel-Station-13/Citadel-Station-13-RP.git
synced 2026-08-19 05:07:06 +01:00
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>
24 lines
684 B
Plaintext
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]
|