Fix grabber checking the wrong ammo value while hooked, when being reloadable
authorMirceaKitsune <sonichedgehog_hyperblast00@yahoo.com>
Mon, 11 Jul 2011 12:46:31 +0000 (15:46 +0300)
committerMirceaKitsune <sonichedgehog_hyperblast00@yahoo.com>
Mon, 11 Jul 2011 12:46:31 +0000 (15:46 +0300)
data/qcsrc/server/w_grabber.qc

index ba0afe7..ca9025f 100644 (file)
@@ -141,7 +141,13 @@ float w_grabber(float req)
                                {\r
                                        if not(self.items & IT_UNLIMITED_WEAPON_AMMO)\r
                                        {\r
-                                               if ( self.ammo_fuel >= (time - self.grabber_time_fueldecrease) * grabbered_fuel )\r
+                                               float active_ammo;\r
+                                               if(cvar("g_balance_grabber_reload_ammo"))\r
+                                                       active_ammo = self.clip_load;\r
+                                               else\r
+                                                       active_ammo = self.ammo_fuel;\r
+\r
+                                               if (active_ammo >= (time - self.grabber_time_fueldecrease) * grabbered_fuel )\r
                                                {\r
                                                        W_DecreaseAmmo(ammo_fuel, (time - self.grabber_time_fueldecrease) * grabbered_fuel, cvar("g_balance_grabber_reload_ammo"));\r
                                                        self.grabber_time_fueldecrease = time;\r