]> git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/blobdiff - qcsrc/server/cl_weapons.qc
fix a stupid interaction between weapon throwing and weapon load (loaded ammo was...
[xonotic/xonotic-data.pk3dir.git] / qcsrc / server / cl_weapons.qc
index fac0d73aa2cbf09b30f36ed949e7bb97a9d26085..94eaccd2daf4a4cc8a46b3afc9982c122b006e38 100644 (file)
@@ -262,7 +262,6 @@ string W_ThrowNewWeapon(entity own, float wpn, float doreduce, vector org, vecto
                                if(wa & j)
                                {
                                        ammofield = Item_CounterField(j);
-                                       wep.ammofield = 0;
 
                                        // if our weapon is loaded, give its load back to the player
                                        if(self.(weapon_load[self.weapon]) > 0)
@@ -270,6 +269,8 @@ string W_ThrowNewWeapon(entity own, float wpn, float doreduce, vector org, vecto
                                                own.ammofield += self.(weapon_load[self.weapon]);
                                                self.(weapon_load[self.weapon]) = -1; // schedule the weapon for reloading
                                        }
+
+                                       wep.ammofield = 0;
                                }
                        }
                }
@@ -280,10 +281,6 @@ string W_ThrowNewWeapon(entity own, float wpn, float doreduce, vector org, vecto
                                if(wa & j)
                                {
                                        ammofield = Item_CounterField(j);
-                                       thisammo = min(own.ammofield, wep.ammofield);
-                                       wep.ammofield = thisammo;
-                                       own.ammofield -= thisammo;
-                                       s = strcat(s, " and ", ftos(thisammo), " ", Item_CounterFieldName(j));
 
                                        // if our weapon is loaded, give its load back to the player
                                        if(self.(weapon_load[self.weapon]) > 0)
@@ -291,6 +288,11 @@ string W_ThrowNewWeapon(entity own, float wpn, float doreduce, vector org, vecto
                                                own.ammofield += self.(weapon_load[self.weapon]);
                                                self.(weapon_load[self.weapon]) = -1; // schedule the weapon for reloading
                                        }
+
+                                       thisammo = min(own.ammofield, wep.ammofield);
+                                       wep.ammofield = thisammo;
+                                       own.ammofield -= thisammo;
+                                       s = strcat(s, " and ", ftos(thisammo), " ", Item_CounterFieldName(j));
                                }
                        }
                        s = substring(s, 5, -1);
@@ -318,7 +320,7 @@ float W_IsWeaponThrowable(float w)
                return 0;
        if (g_cts)
                return 0;
-       if (g_nexball && w == WEP_PORTO)
+       if (g_nexball && w == WEP_GRENADE_LAUNCHER)
                return 0;
 
        wb = W_WeaponBit(w);