From: Rudolf Polzer Date: Sun, 4 Mar 2012 13:44:00 +0000 (+0100) Subject: use the accessors here X-Git-Tag: xonotic-v0.7.0~348^2~1^2~41 X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=88dcad31707c6cd388412f86e29a5e88021236c8;p=xonotic%2Fxonotic-data.pk3dir.git use the accessors here --- diff --git a/qcsrc/common/items.qh b/qcsrc/common/items.qh index f4f315e18..bd97d4399 100644 --- a/qcsrc/common/items.qh +++ b/qcsrc/common/items.qh @@ -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); \ } \