From a8e08174a1e1d9fc68e0d091a85b05c733c1198f Mon Sep 17 00:00:00 2001 From: div0 Date: Wed, 30 Jan 2008 09:03:36 +0000 Subject: [PATCH] minor fix to switching back to previous weapon git-svn-id: svn://svn.icculus.org/nexuiz/trunk@3307 f962a42d-fe04-0410-a3ab-8c8b0445ebaa --- data/qcsrc/server/cl_client.qc | 1 + data/qcsrc/server/cl_weapons.qc | 6 +++--- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/data/qcsrc/server/cl_client.qc b/data/qcsrc/server/cl_client.qc index 022740a2a..0b2d3880e 100644 --- a/data/qcsrc/server/cl_client.qc +++ b/data/qcsrc/server/cl_client.qc @@ -540,6 +540,7 @@ void PutClientInServer (void) self.armorvalue = start_armorvalue; self.items = start_items; self.switchweapon = start_switchweapon; + self.cnt = start_switchweapon; self.weapon = 0; self.jump_interval = time; diff --git a/data/qcsrc/server/cl_weapons.qc b/data/qcsrc/server/cl_weapons.qc index f775f7eaa..a52e40463 100644 --- a/data/qcsrc/server/cl_weapons.qc +++ b/data/qcsrc/server/cl_weapons.qc @@ -146,7 +146,7 @@ void(float imp) W_SwitchWeapon if (self.weapon != imp) if (client_hasweapon(self, imp, TRUE, TRUE)) { - self.cnt = self.weapon; + self.cnt = self.weapon ? self.weapon : self.switchweapon; self.switchweapon = imp; } }; @@ -175,7 +175,7 @@ void() W_NextWeapon = if (weaponwant > WEP_LAST) weaponwant = WEP_FIRST; } - self.cnt = self.weapon; + self.cnt = self.weapon ? self.weapon : self.switchweapon; self.switchweapon = weaponwant; }; @@ -203,7 +203,7 @@ void() W_PreviousWeapon = if (weaponwant > WEP_LAST) weaponwant = WEP_FIRST; } - self.cnt = self.weapon; + self.cnt = self.weapon ? self.weapon : self.switchweapon; self.switchweapon = weaponwant; }; -- 2.39.2