Fix remaining parts of server side code. Reloading will work properly now
authorMirceaKitsune <sonichedgehog_hyperblast00@yahoo.com>
Mon, 28 Feb 2011 14:50:40 +0000 (16:50 +0200)
committerMirceaKitsune <sonichedgehog_hyperblast00@yahoo.com>
Mon, 28 Feb 2011 14:50:40 +0000 (16:50 +0200)
data/qcsrc/server/w_grabber.qc

index 09a945f..126f424 100644 (file)
@@ -74,7 +74,9 @@ float w_grabber(float req)
        }\r
        else if (req == WR_THINK)\r
        {\r
-               if (self.BUTTON_ATCK || (!(self.items & IT_JETPACK) && self.BUTTON_JETPACK))\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
+                       weapon_action(self.weapon, WR_RELOAD);\r
+               else if (self.BUTTON_ATCK || (!(self.items & IT_JETPACK) && self.BUTTON_JETPACK))\r
                {\r
                        if(time < self.weapon_delay)\r
                                return FALSE;\r
@@ -90,8 +92,7 @@ float w_grabber(float req)
                                weapon_thinkf(WFRAME_FIRE1, cvar("g_balance_grabber_primary_animtime"), w_ready);                               \r
                        }\r
                }\r
-\r
-               if (self.BUTTON_ATCK2)\r
+               else if (self.BUTTON_ATCK2)\r
                {\r
                        if (weapon_prepareattack(1, cvar("g_balance_grabber_secondary_refire")))\r
                        {\r
@@ -213,7 +214,7 @@ float w_grabber(float req)
        }\r
        else if (req == WR_RELOAD)\r
        {\r
-               W_Reload(min(cvar("g_balance_hagar_primary_ammo"), cvar("g_balance_hagar_secondary_ammo")), cvar("g_balance_hagar_reload_ammo"), cvar("g_balance_hagar_reload_time"), "weapons/reload.wav");\r
+               W_Reload(min(cvar("g_balance_grabber_primary_ammo"), cvar("g_balance_grabber_secondary_ammo")), cvar("g_balance_grabber_reload_ammo"), cvar("g_balance_grabber_reload_time"), "weapons/reload.wav");\r
        }\r
        else if (req == WR_SUICIDEMESSAGE)\r
                w_deathtypestring = "did the impossible";\r