From 20039ab1fcefca212905b597dd08a5b20eaabd20 Mon Sep 17 00:00:00 2001 From: Kapu1178 <75460809+Kapu1178@users.noreply.github.com> Date: Fri, 15 Nov 2024 14:25:31 -0500 Subject: [PATCH] fix is_station_level (#1112) --- code/__HELPERS/level_traits.dm | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/code/__HELPERS/level_traits.dm b/code/__HELPERS/level_traits.dm index 805e9466aec0..f78e8476b284 100644 --- a/code/__HELPERS/level_traits.dm +++ b/code/__HELPERS/level_traits.dm @@ -9,15 +9,17 @@ GLOBAL_LIST_EMPTY(station_levels_cache) GLOBAL_VAR(station_level_z_scratch) // Called a lot, somewhat slow, so has its own cache -#define is_station_level(z) \ +#define is_station_level(z_level) \ ( \ + (z_level) && ( \ ( \ /* The right hand side of this guarantees that we'll have the space to fill later on, while also not failing the condition */ \ - (GLOB.station_levels_cache.len < (GLOB.station_level_z_scratch = z) && (GLOB.station_levels_cache.len = GLOB.station_level_z_scratch)) \ + (GLOB.station_levels_cache.len < (GLOB.station_level_z_scratch = (z_level)) && (GLOB.station_levels_cache.len = GLOB.station_level_z_scratch)) \ || isnull(GLOB.station_levels_cache[GLOB.station_level_z_scratch]) \ ) \ - ? (GLOB.station_levels_cache[GLOB.station_level_z_scratch] = !!SSmapping.level_trait(z, ZTRAIT_STATION)) \ + ? (GLOB.station_levels_cache[GLOB.station_level_z_scratch] = !!SSmapping.level_trait(GLOB.station_level_z_scratch, ZTRAIT_STATION)) \ : GLOB.station_levels_cache[GLOB.station_level_z_scratch] \ + ) \ ) #define is_mining_level(z) SSmapping.level_trait(z, ZTRAIT_MINING)