Fix the CHECK_MULTIPLE_BITFIELDS macro (#43505)

Found by TGMC people, the CHECK_MULTIPLE_BITFIELDS macro wasn't
parenthesing the == rvalue, so

CHECK_MULTIPLE_BITFIELDS(var, flag1 | flag 2)

would come as
(var & (flag 1 | flag 2)) == flag 1 | flag2

instead of
(var & (flag 1 | flag 2)) == (flag 1 | flag2)

making the check always pass when a second flag was checked.

Only /datum/component/footstep/proc/play_footstep() was using it in that
way though and it doesn't seems it was impacting it much.
This commit is contained in:
Menshin
2019-04-06 12:36:05 -07:00
committed by Tad Hardesty
parent 772be289ce
commit db7ddeee4a
+2 -2
View File
@@ -12,7 +12,7 @@
//check if all bitflags specified are present
#define CHECK_MULTIPLE_BITFIELDS(flagvar, flags) ((flagvar & (flags)) == flags)
#define CHECK_MULTIPLE_BITFIELDS(flagvar, flags) (((flagvar) & (flags)) == (flags))
GLOBAL_LIST_INIT(bitflags, list(1, 2, 4, 8, 16, 32, 64, 128, 256, 512, 1024, 2048, 4096, 8192, 16384, 32768))
@@ -159,4 +159,4 @@ GLOBAL_LIST_INIT(bitflags, list(1, 2, 4, 8, 16, 32, 64, 128, 256, 512, 1024, 204
//alternate appearance flags
#define AA_TARGET_SEE_APPEARANCE (1<<0)
#define AA_MATCH_TARGET_OVERLAYS (1<<1)
#define AA_MATCH_TARGET_OVERLAYS (1<<1)