Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix is_station_level #1112

Merged
merged 1 commit into from
Nov 15, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 5 additions & 3 deletions code/__HELPERS/level_traits.dm
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
Loading