]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
use the accessors here
authorRudolf Polzer <divverent@alientrap.org>
Sun, 4 Mar 2012 13:44:00 +0000 (14:44 +0100)
committerRudolf Polzer <divverent@alientrap.org>
Sun, 4 Mar 2012 13:44:00 +0000 (14:44 +0100)
qcsrc/common/items.qh

index f4f315e185f45309ac2b5920619fe21904e9fe6c..bd97d4399292ce8bd8a3d8f7ccafe151df3edcd3 100644 (file)
@@ -130,6 +130,7 @@ float WEP_LAST;
 #define WEP_MAXCOUNT 24
 float WEPBIT_ALL;
 float WEPBIT_SUPERWEAPONS;
+// note: the fabs call is just there to hide "if result is constant" warning
 #define REGISTER_WEAPON_2(id,bit,func,ammotype,i,weapontype,pickupbasevalue,modelname,shortname,wname) \
        float id; \
        float bit; \
@@ -137,8 +138,9 @@ float WEPBIT_SUPERWEAPONS;
        void RegisterWeapons_##id() \
        { \
                WEP_LAST = (id = WEP_FIRST + WEP_COUNT); \
-               WEPBIT_ALL |= (bit = power2of(WEP_COUNT)); \
-               WEPBIT_SUPERWEAPONS |= (bit = power2of(WEP_COUNT)) * !!(weapontype & WEP_FLAG_SUPERWEAPON); \
+               WEPBITS_OR_AW(WEPBIT_ALL, id); \
+               if(fabs(weapontype & WEP_FLAG_SUPERWEAPON)) \
+                       WEPBITS_OR_AW(WEPBIT_SUPERWEAPONS, id); \
                ++WEP_COUNT; \
                register_weapon(id,func,ammotype,i,weapontype,pickupbasevalue,modelname,shortname,wname); \
        } \