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

29 lines
939 B
Plaintext

//* This file is explicitly licensed under the MIT license. *//
//* Copyright (c) 2024 Citadel Station Developers *//
/**
* Sort by ascending struct z
*/
/proc/cmp_map_level_struct_z_asc(datum/map_level/A, datum/map_level/B)
return A.struct_z - B.struct_z
/**
* Returns load order. This is needed because z-mimic requires levels to be ascending in order for two
* given multi-z levels.
*/
/proc/cmp_map_level_load_sequence(datum/map_level/A, datum/map_level/B)
// shit with no struct always goes last
var/A_has_struct = A.is_in_struct()
var/B_has_struct = B.is_in_struct()
if(A_has_struct != B_has_struct)
if(A_has_struct && !B_has_struct)
return -1 // A before B
else if(B_has_struct && !A_has_struct)
return 1 // B before A
CRASH("unreachable")
if(A.struct_x != B.struct_x)
return A.struct_x - B.struct_x
if(A.struct_y != B.struct_y)
return A.struct_y - B.struct_y
return A.struct_z - B.struct_z