]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
simplify some hacks
authorRudolf Polzer <divverent@alientrap.org>
Thu, 12 Jan 2012 17:28:41 +0000 (18:28 +0100)
committerRudolf Polzer <divverent@alientrap.org>
Thu, 12 Jan 2012 17:28:41 +0000 (18:28 +0100)
qcsrc/common/items.qh
qcsrc/server/cl_weapons.qc
qcsrc/server/cl_weaponsystem.qc

index 6775e1edd5a44f30ca7fb5e516d35f0345dbfd49..23a94e4f96b435e87aba316d0a7db4a6ada1cd24 100644 (file)
@@ -46,7 +46,7 @@ float IT_25HP                                 = 1048576;
 float  IT_ARMOR_SHARD                  = 2097152;
 float  IT_ARMOR                                = 4194304;
 
-float  IT_AMMO                                 = 8064; // IT_SHELLS | IT_NAILS | IT_ROCKETS | IT_CELLS | IT_SUPERWEAPON | IT_FUEL;
+float  IT_AMMO                                 = 3968; // IT_SHELLS | IT_NAILS | IT_ROCKETS | IT_CELLS | IT_FUEL;
 float  IT_PICKUPMASK           = 51; // IT_FUEL_REGEN | IT_JETPACK | IT_UNLIMITED_AMMO; // strength and invincible are handled separately
 float  IT_UNLIMITED_AMMO       = 3; // IT_UNLIMITED_SUPERWEAPONS | IT_UNLIMITED_WEAPON_AMMO;
 
index b3169bed51f36380953659cb1adf271e310a874c..8c0cb96e0eb4f0627867800f7691eb979aa53af2 100644 (file)
@@ -170,9 +170,7 @@ float W_WeaponBit(float wpn)
 
 float W_AmmoItemCode(float wpn)
 {
-       float f = (get_weaponinfo(wpn)).items;
-       f &~= IT_SUPERWEAPON;
-       return f;
+       return (get_weaponinfo(wpn)).items & IT_AMMO;
 }
 
 void thrown_wep_think()
index 3b69e13eb0942f30b1e394a3a7b0813ae6e3cce7..1208766e21a99fca98117786b7391e0cb312d6f4 100644 (file)
@@ -853,7 +853,7 @@ void weapon_setup(float windex)
        entity e;
        e = get_weaponinfo(windex);
        self.items &~= IT_AMMO;
-       self.items = self.items | e.items;
+       self.items = self.items | (e.items & IT_AMMO);
 
        // the two weapon entities will notice this has changed and update their models
        self.weapon = windex;