]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
disallow crouching + melee attack, this prevents exploit where melee animation is...
authorFruitieX <fruitiex@gmail.com>
Thu, 26 May 2011 00:14:25 +0000 (03:14 +0300)
committerFruitieX <fruitiex@gmail.com>
Thu, 26 May 2011 00:14:25 +0000 (03:14 +0300)
qcsrc/server/cl_client.qc
qcsrc/server/w_shotgun.qc

index ffeba55eb29fe279daac7af0a587b420877635b4..18ec6f9cac2762ab67b7c52813844f88e2ff0650 100644 (file)
@@ -2817,7 +2817,7 @@ void PlayerPreThink (void)
 
                self.prevorigin = self.origin;
 
-               if ((self.BUTTON_CROUCH && !self.hook.state) || self.health <= g_bloodloss)
+               if (((self.BUTTON_CROUCH && !self.hook.state) || self.health <= g_bloodloss) && self.animstate_startframe != 23) // prevent crouching if using melee attack
                {
                        if (!self.crouch)
                        {
index 635b1ccf8b959ac753e4f06ef493605e9049b973..f9bcc251f46c8084e454dc52d0bd972149b44158 100644 (file)
@@ -132,6 +132,7 @@ float w_shotgun(float req)
                        }
                }
                if (self.clip_load >= 0) // we are not currently reloading
+               if (!self.crouch) // we are not currently crouching; this fixes an exploit where your melee anim is not visible, and besides wouldn't make much sense
                if (self.BUTTON_ATCK2 && autocvar_g_balance_shotgun_secondary)
                if (weapon_prepareattack(1, autocvar_g_balance_shotgun_secondary_refire))
                {