From 3dd46d0b03118785a8965acaee2f39a8290bcff6 Mon Sep 17 00:00:00 2001 From: Mircea Kitsune Date: Fri, 21 Jan 2011 18:45:38 +0200 Subject: [PATCH] Proper complaining when there's no ammo to reload --- qcsrc/server/cl_weaponsystem.qc | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/qcsrc/server/cl_weaponsystem.qc b/qcsrc/server/cl_weaponsystem.qc index cb8ff3d59..94074f100 100644 --- a/qcsrc/server/cl_weaponsystem.qc +++ b/qcsrc/server/cl_weaponsystem.qc @@ -1627,6 +1627,7 @@ void W_SetupProjectileVelocity(entity missile, float pSpeed, float spread) #define W_SETUPPROJECTILEVELOCITY(m,s) W_SetupProjectileVelocityEx(m, w_shotdir, v_up, cvar(#s "_speed"), 0, 0, cvar(#s "_spread"), FALSE) // shared weapon reload code +.float reload_complain; float W_ReloadCheck(float ammo_amount) { entity e; @@ -1639,7 +1640,12 @@ float W_ReloadCheck(float ammo_amount) // no ammo, so nothing to load if(!ammo_amount) { - print("Cannot reload, not enough ammo\n"); + if(clienttype(self) == CLIENTTYPE_REAL && self.reload_complain < time) + { + play2(self, "weapons/unavailable.wav"); + sprint(self, strcat("You don't have any ammo to reload the ^2", W_Name(self.weapon), "\n")); + self.reload_complain = time + 1; + } self.ammo_counter = -1; // reload later W_SwitchToOtherWeapon(self); return 0; -- 2.39.2