Don't allow one grabber firing button to block the other off
authorMirceaKitsune <sonichedgehog_hyperblast00@yahoo.com>
Mon, 28 Feb 2011 16:07:15 +0000 (18:07 +0200)
committerMirceaKitsune <sonichedgehog_hyperblast00@yahoo.com>
Mon, 28 Feb 2011 16:07:15 +0000 (18:07 +0200)
data/qcsrc/server/w_grabber.qc

index 844915a..4e39d09 100644 (file)
@@ -82,28 +82,31 @@ float w_grabber(float req)
                        if(self.ammo_fuel >= 1) // we only have one weapon in VT, so nothing else to switch to if we're out of ammo\r
                                weapon_action(self.weapon, WR_RELOAD);\r
                }\r
-               else if (self.BUTTON_ATCK || (!(self.items & IT_JETPACK) && self.BUTTON_JETPACK))\r
+               else\r
                {\r
-                       if(time < self.weapon_delay)\r
-                               return FALSE;\r
-\r
-                       if(!self.grabber)\r
-                       if not(self.grabber_state & GRABBER_WAITING_FOR_RELEASE)\r
-                       if not(self.grabber_state & GRABBER_FIRING)\r
-                       if (time > self.grabber_refire)\r
-                       if (weapon_prepareattack(0, -1))\r
+                       if (self.BUTTON_ATCK || (!(self.items & IT_JETPACK) && self.BUTTON_JETPACK))\r
                        {\r
-                               W_DecreaseAmmo(ammo_fuel, cvar("g_balance_grabber_primary_ammo"), cvar("g_balance_grabber_reload_ammo"));\r
-                               self.grabber_state |= GRABBER_FIRING;\r
-                               weapon_thinkf(WFRAME_FIRE1, cvar("g_balance_grabber_primary_animtime"), w_ready);                               \r
+                               if(time < self.weapon_delay)\r
+                                       return FALSE;\r
+\r
+                               if(!self.grabber)\r
+                               if not(self.grabber_state & GRABBER_WAITING_FOR_RELEASE)\r
+                               if not(self.grabber_state & GRABBER_FIRING)\r
+                               if (time > self.grabber_refire)\r
+                               if (weapon_prepareattack(0, -1))\r
+                               {\r
+                                       W_DecreaseAmmo(ammo_fuel, cvar("g_balance_grabber_primary_ammo"), cvar("g_balance_grabber_reload_ammo"));\r
+                                       self.grabber_state |= GRABBER_FIRING;\r
+                                       weapon_thinkf(WFRAME_FIRE1, cvar("g_balance_grabber_primary_animtime"), w_ready);                               \r
+                               }\r
                        }\r
-               }\r
-               else if (self.BUTTON_ATCK2)\r
-               {\r
-                       if (weapon_prepareattack(1, cvar("g_balance_grabber_secondary_refire")))\r
+                       if (self.BUTTON_ATCK2)\r
                        {\r
-                               W_Grabber_Attack2();\r
-                               weapon_thinkf(WFRAME_FIRE2, cvar("g_balance_grabber_secondary_animtime"), w_ready);\r
+                               if (weapon_prepareattack(1, cvar("g_balance_grabber_secondary_refire")))\r
+                               {\r
+                                       W_Grabber_Attack2();\r
+                                       weapon_thinkf(WFRAME_FIRE2, cvar("g_balance_grabber_secondary_animtime"), w_ready);\r
+                               }\r
                        }\r
                }\r
 \r