From: Rudolf Polzer Date: Thu, 12 Jan 2012 17:28:41 +0000 (+0100) Subject: simplify some hacks X-Git-Tag: xonotic-v0.6.0~177^2^2~4 X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=d7b327f92ccc87d235ee8ba026e7054a8e2e83fe;p=xonotic%2Fxonotic-data.pk3dir.git simplify some hacks --- diff --git a/qcsrc/common/items.qh b/qcsrc/common/items.qh index 6775e1edd..23a94e4f9 100644 --- a/qcsrc/common/items.qh +++ b/qcsrc/common/items.qh @@ -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; diff --git a/qcsrc/server/cl_weapons.qc b/qcsrc/server/cl_weapons.qc index b3169bed5..8c0cb96e0 100644 --- a/qcsrc/server/cl_weapons.qc +++ b/qcsrc/server/cl_weapons.qc @@ -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() diff --git a/qcsrc/server/cl_weaponsystem.qc b/qcsrc/server/cl_weaponsystem.qc index 3b69e13eb..1208766e2 100644 --- a/qcsrc/server/cl_weaponsystem.qc +++ b/qcsrc/server/cl_weaponsystem.qc @@ -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;