mirror of
https://github.com/Bubberstation/Bubberstation.git
synced 2025-12-09 07:46:20 +00:00
## About The Pull Request Makes wrapper procs to support working with bitflags as defined "things" rather then EXCLUSIVELY numbers, mostly for getting random flags. I've ~~also added a unit test to prevent bitfields from being double defined~~ stolen some code form moth to make double definitions here a compile error. This does rely on people actually using the bitfield lists, essentially upgrading them from breaking just admin debug to POTENTIALLY breaking game logic (slightly). Would like input on this @tgstation/commit-access ## Why It's Good For The Game More tools for feature coders to play with, more sane code
9 lines
388 B
Plaintext
9 lines
388 B
Plaintext
#define DEFINE_BITFIELD(_variable, _flags) \
|
|
/* Important note: This exists to throw a compile time warning if more then one bitfield with the same name is defined */ \
|
|
/* This is required to avoid dupes in vv, and any consumers of our bitfield metainfo procs */ \
|
|
GLOBAL_REAL_VAR(_bitfield_##_variable); \
|
|
/datum/bitfield/##_variable { \
|
|
flags = ##_flags; \
|
|
variable = #_variable; \
|
|
}
|