From 9d25e76b96eb2e1c51f7f86e726fe7a8ad20e390 Mon Sep 17 00:00:00 2001 From: Mario Date: Mon, 26 Sep 2022 00:20:20 +1000 Subject: [PATCH] Make the boolean macro explicitly return 1 or 0, allow compiling without -Wno-F324 --- qcsrc/lib/bool.qh | 2 +- qcsrc/server/items/items.qc | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/qcsrc/lib/bool.qh b/qcsrc/lib/bool.qh index c78f717d9..6a9da66f0 100644 --- a/qcsrc/lib/bool.qh +++ b/qcsrc/lib/bool.qh @@ -6,7 +6,7 @@ const int false = 0; #endif -#define boolean(value) ((value) != 0) +#define boolean(value) (((value) != 0) ? 1 : 0) // get true/false value of a string with multiple different inputs ERASEABLE diff --git a/qcsrc/server/items/items.qc b/qcsrc/server/items/items.qc index 7d1c46f3f..0977a7d3c 100644 --- a/qcsrc/server/items/items.qc +++ b/qcsrc/server/items/items.qc @@ -1348,7 +1348,7 @@ spawnfunc(target_items) res = GetResource(this, RES_HEALTH); if(res != 0) str = sprintf("%s %s%d %s", str, valueprefix, max(0, res), "health"); res = GetResource(this, RES_ARMOR); if(res != 0) str = sprintf("%s %s%d %s", str, valueprefix, max(0, res), "armor"); FOREACH(StatusEffect, it.instanceOfBuff, str = sprintf("%s %s%d %s", str, valueprefix, this.buffs_finished * boolean(this.buffdef == it), it.netname)); - FOREACH(Weapons, it != WEP_Null, str = sprintf("%s %s%d %s", str, itemprefix, !!(STAT(WEAPONS, this) & (it.m_wepset)), it.netname)); + FOREACH(Weapons, it != WEP_Null, str = sprintf("%s %s%d %s", str, itemprefix, boolean(!!(STAT(WEAPONS, this) & (it.m_wepset))), it.netname)); } this.netname = strzone(str); -- 2.39.2