Fix an issue with forced reloading. It shouldn't force reload while you are hooked...
authorMirceaKitsune <sonichedgehog_hyperblast00@yahoo.com>
Mon, 28 Feb 2011 16:05:58 +0000 (18:05 +0200)
committerMirceaKitsune <sonichedgehog_hyperblast00@yahoo.com>
Mon, 28 Feb 2011 16:05:58 +0000 (18:05 +0200)
data/qcsrc/server/w_grabber.qc

index 0a9bdf8..844915a 100644 (file)
@@ -74,7 +74,10 @@ float w_grabber(float req)
        }\r
        else if (req == WR_THINK)\r
        {\r
-               if(cvar("g_balance_grabber_reload_ammo") && self.clip_load < min(cvar("g_balance_grabber_primary_ammo"), cvar("g_balance_grabber_secondary_ammo"))) // forced reload\r
+               grabbered_fuel = cvar("g_balance_grabber_primary_grabbered_fuel");\r
+               // forced reload\r
+               if(cvar("g_balance_grabber_reload_ammo") && self.clip_load < min(cvar("g_balance_grabber_primary_ammo"), cvar("g_balance_grabber_secondary_ammo"))\r
+               && !(self.clip_load >= (time - self.grabber_time_fueldecrease) * grabbered_fuel && self.BUTTON_ATCK)) // not while hooked and still have ammo to stay hooked\r
                {\r
                        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
@@ -122,8 +125,7 @@ float w_grabber(float req)
                                if ( time > self.grabber_time_grabbered + grabbered_time_max )\r
                                        self.grabber_state |= GRABBER_REMOVING;\r
                        }\r
-                       \r
-                       grabbered_fuel = cvar("g_balance_grabber_primary_grabbered_fuel");\r
+\r
                        if (grabbered_fuel > 0)\r
                        {\r
                                if ( time > self.grabber_time_fueldecrease )\r