From: Mircea Kitsune Date: Sun, 30 Jan 2011 20:56:30 +0000 (+0200) Subject: Fix laser setting the last used ammo to 1 when reloading it after having switched... X-Git-Tag: xonotic-v0.5.0~309^2~7^2~63 X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=fa05d87635808e8569add3dca4be9685af7eed46;p=xonotic%2Fxonotic-data.pk3dir.git Fix laser setting the last used ammo to 1 when reloading it after having switched to another weapon. We need to use a field float there that is always 0, or the ..float sets the last ammo instead of reporting no ammo. --- diff --git a/qcsrc/server/defs.qh b/qcsrc/server/defs.qh index 0c7b0e86e..d37af0d12 100644 --- a/qcsrc/server/defs.qh +++ b/qcsrc/server/defs.qh @@ -613,6 +613,7 @@ float client_cefc_accumulatortime; #endif .float weapon_load[WEP_MAXCOUNT]; FTEQCC_YOU_SUCK_THIS_IS_NOT_UNREFERENCED(weapon_load); +.float zero_ammo; // used by the reloading system, must always be 0 .float clip_load; .float old_clip_load; .float clip_size; diff --git a/qcsrc/server/w_laser.qc b/qcsrc/server/w_laser.qc index 3f902ac94..1b5dfcb1c 100644 --- a/qcsrc/server/w_laser.qc +++ b/qcsrc/server/w_laser.qc @@ -6,7 +6,7 @@ void(float imp) W_SwitchWeapon; void W_Laser_Reload() { - self.(self.reload_ammo_player) = 1; + self.reload_ammo_player = zero_ammo; self.reload_ammo_min = 0; self.reload_ammo_amount = autocvar_g_balance_laser_reload_ammo; self.reload_time = autocvar_g_balance_laser_reload_time;