]> git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
Make the boolean macro explicitly return 1 or 0, allow compiling without -Wno-F324 Mario/misc_tweaks
authorMario <mario.mario@y7mail.com>
Sun, 25 Sep 2022 14:20:20 +0000 (00:20 +1000)
committerMario <mario.mario@y7mail.com>
Sun, 25 Sep 2022 14:20:20 +0000 (00:20 +1000)
qcsrc/lib/bool.qh
qcsrc/server/items/items.qc

index c78f717d9e983be74923a5dd8fb5252b73f9b627..6a9da66f0add611faf9e3fd2dd512a983d4fe91b 100644 (file)
@@ -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
index 7d1c46f3f30b7c5a8dbcedb66d10580994aa3f27..0977a7d3cb2dbfe549248fa972079dc76ed71937 100644 (file)
@@ -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);