Skip to content

Commit 20039ab

Browse files
authored
fix is_station_level (#1112)
1 parent adc2872 commit 20039ab

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

code/__HELPERS/level_traits.dm

+5-3
Original file line numberDiff line numberDiff line change
@@ -9,15 +9,17 @@ GLOBAL_LIST_EMPTY(station_levels_cache)
99
GLOBAL_VAR(station_level_z_scratch)
1010

1111
// Called a lot, somewhat slow, so has its own cache
12-
#define is_station_level(z) \
12+
#define is_station_level(z_level) \
1313
( \
14+
(z_level) && ( \
1415
( \
1516
/* The right hand side of this guarantees that we'll have the space to fill later on, while also not failing the condition */ \
16-
(GLOB.station_levels_cache.len < (GLOB.station_level_z_scratch = z) && (GLOB.station_levels_cache.len = GLOB.station_level_z_scratch)) \
17+
(GLOB.station_levels_cache.len < (GLOB.station_level_z_scratch = (z_level)) && (GLOB.station_levels_cache.len = GLOB.station_level_z_scratch)) \
1718
|| isnull(GLOB.station_levels_cache[GLOB.station_level_z_scratch]) \
1819
) \
19-
? (GLOB.station_levels_cache[GLOB.station_level_z_scratch] = !!SSmapping.level_trait(z, ZTRAIT_STATION)) \
20+
? (GLOB.station_levels_cache[GLOB.station_level_z_scratch] = !!SSmapping.level_trait(GLOB.station_level_z_scratch, ZTRAIT_STATION)) \
2021
: GLOB.station_levels_cache[GLOB.station_level_z_scratch] \
22+
) \
2123
)
2224

2325
#define is_mining_level(z) SSmapping.level_trait(z, ZTRAIT_MINING)

0 commit comments

Comments
 (0)