From 81eeee74b314802d8decf44de6d01395e240f38d Mon Sep 17 00:00:00 2001 From: Mario Date: Sat, 6 Dec 2014 00:13:58 +1100 Subject: [PATCH] Duplicate some bad code for the sake of fixing bot melee spam when out of ammo (WEAPONTODO) --- qcsrc/common/weapons/w_shotgun.qc | 3 +++ 1 file changed, 3 insertions(+) diff --git a/qcsrc/common/weapons/w_shotgun.qc b/qcsrc/common/weapons/w_shotgun.qc index 3cf527d39..9227cdab4 100644 --- a/qcsrc/common/weapons/w_shotgun.qc +++ b/qcsrc/common/weapons/w_shotgun.qc @@ -308,6 +308,9 @@ float W_Shotgun(float req) } case WR_CHECKAMMO2: { + if(IS_BOT_CLIENT(self)) + if(vlen(self.origin-self.enemy.origin) > WEP_CVAR_SEC(shotgun, melee_range)) + return FALSE; // bots cannot use secondary out of range (fixes constant melee when out of ammo) switch(WEP_CVAR(shotgun, secondary)) { case 1: return TRUE; // melee does not use ammo -- 2.39.2