Files
Bubberstation/code/__DEFINES/map_switch.dm
FalloutFalcon 93185eeb3e WHEN_MAP() and WHEN_COMPILE() (#93774)
## About The Pull Request
Alternatives for MAP_SWITCH when you dont have an "alternative" you
want, e.g if you want to override the icon file for mapping but want the
type to inherit its parents icon file otherwise

Also tweaks the syntax on the space turf map switches because I didnt
realize that was the standard here.

Minor bonus of it being a bit clearer for people who dont know the arg
order of mapswitch

Partial upstreaming of https://github.com/DarkPack13/SecondCity/pull/89

## Why It's Good For The Game
More convenient to write.
## Changelog
N/A
2025-11-04 21:25:24 +01:00

13 lines
605 B
Plaintext

/// Uses the left operator when compiling, uses the right operator when not compiling.
// Currently uses the CBT macro, but if http://www.byond.com/forum/post/2831057 is ever added,
// or if map tools ever agree on a standard, this should switch to use that.
#ifdef CBT
#define MAP_SWITCH(compile_time, map_time) ##compile_time
#define WHEN_MAP(map_time) // Not mapping, nothing here
#define WHEN_COMPILE(compile_time) ##compile_time
#else
#define MAP_SWITCH(compile_time, map_time) ##map_time
#define WHEN_MAP(map_time) ##map_time
#define WHEN_COMPILE(compile_time) // Not compiling, nothing here
#endif