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

index bd97d4399292ce8bd8a3d8f7ccafe151df3edcd3..2256e4d0e4818bd14eae857c1de8524548958d72 100644 (file)
@@ -94,30 +94,35 @@ void register_weapons_done();
 # define WEPBITS_CLEAR_A(a) ((a) = 0)
 
 # define WEPBITS_COPY_EE(e,e2) ((e).weapons = (e2).weapons)
+# define WEPBITS_EQ_EE(e,e2) ((e).weapons == (e2).weapons)
 # define WEPBITS_OR_EE(e,e2) ((e).weapons |= (e2).weapons)
 # define WEPBITS_AND_EE(e,e2) ((e).weapons &= (e2).weapons)
 # define WEPBITS_ANDNOT_EE(e,e2) ((e).weapons &~= (e2).weapons)
 # define WEPBITS_TEST_EE(e,e2) ((e).weapons & (e2).weapons)
 
 # define WEPBITS_COPY_EA(e,a) ((e).weapons = (a))
+# define WEPBITS_EQ_EA(e,a) ((e).weapons == (a))
 # define WEPBITS_OR_EA(e,a) ((e).weapons |= (a))
 # define WEPBITS_AND_EA(e,a) ((e).weapons &= (a))
 # define WEPBITS_ANDNOT_EA(e,a) ((e).weapons &~= (a))
 # define WEPBITS_TEST_EA(e,a) ((e).weapons & (a))
 
 # define WEPBITS_COPY_AA(a,a2) ((a) = (a2))
+# define WEPBITS_EQ_AA(a,a2) ((a) == (a2))
 # define WEPBITS_OR_AA(a,a2) ((a) |= (a2))
 # define WEPBITS_AND_AA(a,a2) ((a) &= (a2))
 # define WEPBITS_ANDNOT_AA(a,a2) ((a) &~= (a2))
 # define WEPBITS_TEST_AA(a,a2) ((a) & (a2))
 
 # define WEPBITS_COPY_EW(e,w) ((e).weapons = power2of((w) - WEP_FIRST))
+# define WEPBITS_EQ_EW(e,w) ((e).weapons == power2of((w) - WEP_FIRST))
 # define WEPBITS_OR_EW(e,w) ((e).weapons |= power2of((w) - WEP_FIRST))
 # define WEPBITS_AND_EW(e,w) ((e).weapons &= power2of((w) - WEP_FIRST))
 # define WEPBITS_ANDNOT_EW(e,w) ((e).weapons &~= power2of((w) - WEP_FIRST))
 # define WEPBITS_TEST_EW(e,w) ((e).weapons & power2of((w) - WEP_FIRST))
 
 # define WEPBITS_COPY_AW(a,w) ((a) = power2of((w) - WEP_FIRST))
+# define WEPBITS_EQ_AW(a,w) ((a) == power2of((w) - WEP_FIRST))
 # define WEPBITS_OR_AW(a,w) ((a) |= power2of((w) - WEP_FIRST))
 # define WEPBITS_AND_AW(a,w) ((a) &= power2of((w) - WEP_FIRST))
 # define WEPBITS_ANDNOT_AW(a,w) ((a) &~= power2of((w) - WEP_FIRST))
index 848cbe030ade9d591442d107acd5095a1db1cdda..c213f7adbde7a74c315df885526899b3e11438c8 100644 (file)
@@ -749,7 +749,7 @@ void PutClientInServer (void)
                        self.weapons = start_weapons;
                }
 
-               if(self.weapons & WEPBIT_SUPERWEAPONS) // exception for minstagib, as minstanex is a superweapon
+               if(WEPBITS_TEST_EA(self, WEPBIT_SUPERWEAPONS)) // exception for minstagib, as minstanex is a superweapon
                        self.superweapons_finished = time + autocvar_g_balance_superweapons_time;
                else
                        self.superweapons_finished = 0;
@@ -757,10 +757,10 @@ void PutClientInServer (void)
                if(g_weaponarena_random)
                {
                        if(g_weaponarena_random_with_laser)
-                               self.weapons &~= WEPBIT_LASER;
+                               WEPBITS_ANDNOT_EW(self, WEPBIT_LASER);
                        self.weapons = randombits(self.weapons, g_weaponarena_random, FALSE);
                        if(g_weaponarena_random_with_laser)
-                               self.weapons |= WEPBIT_LASER;
+                               WEPBITS_OR_EW(self, WEPBIT_LASER);
                }
 
                self.items = start_items;