mirror of
https://github.com/Citadel-Station-13/Citadel-Station-13-RP.git
synced 2026-08-18 00:56:34 +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>
18 lines
658 B
Plaintext
18 lines
658 B
Plaintext
//* This file is explicitly licensed under the MIT license. *//
|
|
//* Copyright (c) 2025 Citadel Station Developers *//
|
|
|
|
/**
|
|
* gets an reusable level, or increments world.maxz
|
|
*
|
|
* * This will always return the lowest z-index first.
|
|
* * The returned level must be used or deallocated / readded to 'ordered_reusable', or it will be leaked!
|
|
*/
|
|
/datum/controller/subsystem/mapping/proc/allocate_z_index()
|
|
if(islist(ordered_reusable_levels) && length(ordered_reusable_levels))
|
|
. = ordered_reusable_levels[1]
|
|
ordered_reusable_levels.Cut(1, 2)
|
|
else
|
|
ASSERT(ordered_levels.len == world.maxz)
|
|
ordered_levels.len++
|
|
. = world.increment_max_z()
|