Don't allow reloading in the stomach (once again). If we are swallowed while reloadin...
authorMirceaKitsune <sonichedgehog_hyperblast00@yahoo.com>
Mon, 18 Apr 2011 15:26:37 +0000 (18:26 +0300)
committerMirceaKitsune <sonichedgehog_hyperblast00@yahoo.com>
Mon, 18 Apr 2011 15:26:37 +0000 (18:26 +0300)
data/qcsrc/server/cl_weaponsystem.qc
data/qcsrc/server/w_grabber.qc

index e8f7fcd..9716e98 100644 (file)
@@ -1569,6 +1569,14 @@ void W_DecreaseAmmo(.float ammo_type, float ammo_use, float ammo_reload)
 \r
 void W_ReloadedAndReady()\r
 {\r
+       // if we are inside the stomach, don't allow reloading, and schedule the weapon to reload once when we're out\r
+       if(self.predator.classname == "player")\r
+       {\r
+               self.clip_load = self.weapon_load[self.weapon] = -1;\r
+               w_ready(); // don't keep executing each frame\r
+               return;\r
+       }\r
+\r
        // finish the reloading process, and do the ammo transfer\r
 \r
        self.clip_load = self.old_clip_load; // restore the ammo counter, in case we still had ammo in the weapon before reloading\r
@@ -1597,6 +1605,10 @@ void W_ReloadedAndReady()
 \r
 void W_Reload(float sent_ammo_min, float sent_ammo_amount, float sent_time, string sent_sound)\r
 {\r
+       // if we are inside the stomach, don't allow reloading\r
+       if(self.predator.classname == "player")\r
+               return;\r
+\r
        // set global values to work with\r
        self.reload_ammo_min = sent_ammo_min;\r
        self.reload_ammo_amount = sent_ammo_amount;\r
index f2cd829..b9ac88c 100644 (file)
@@ -85,7 +85,7 @@ 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 not(self.clip_load < 0) // we're currently reloading\r
+               else if not(self.clip_load < 0) // we're not currently reloading\r
                {\r
                        if (self.BUTTON_ATCK)\r
                        {\r