From: Mircea Kitsune Date: Fri, 21 Jan 2011 16:45:38 +0000 (+0200) Subject: Proper complaining when there's no ammo to reload X-Git-Tag: xonotic-v0.5.0~309^2~7^2~154 X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=3dd46d0b03118785a8965acaee2f39a8290bcff6;p=xonotic%2Fxonotic-data.pk3dir.git Proper complaining when there's no ammo to reload --- 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;