From c3fa9ac2168a6d1977d45a7f27d6af4a445a3b41 Mon Sep 17 00:00:00 2001 From: cypress Date: Tue, 17 Oct 2023 09:45:14 -0400 Subject: [PATCH] SERVER: Give player a clip if they have no ammo in Last Stand --- source/server/damage.qc | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/source/server/damage.qc b/source/server/damage.qc index 467d974..df4a7df 100644 --- a/source/server/damage.qc +++ b/source/server/damage.qc @@ -276,11 +276,12 @@ void() GetDown = self.currentmagbk2 = self.weapons[0].weapon_magazine_left; // If it's greater than the mag size, we can fill the magazine. - if (total_ammo > getWeaponMag(self.weapon)) { + if (total_ammo > getWeaponMag(self.weapon) || total_ammo == 0) { self.weapons[0].weapon_magazine = getWeaponMag(self.weapon); // subtract it from the total ammo - total_ammo -= self.weapons[0].weapon_magazine; + if (total_ammo != 0) + total_ammo -= self.weapons[0].weapon_magazine; } else { self.weapons[0].weapon_magazine = total_ammo; total_ammo = 0; @@ -288,11 +289,12 @@ void() GetDown = // Check for dual wield mag too if (IsDualWeapon(self.weapon)) { - if (total_ammo > getWeaponMag(self.weapon)) { + if (total_ammo > getWeaponMag(self.weapon) || total_ammo == 0) { self.weapons[0].weapon_magazine_left = getWeaponMag(self.weapon); // subtract it from the total ammo - total_ammo -= self.weapons[0].weapon_magazine_left; + if (total_ammo != 0) + total_ammo -= self.weapons[0].weapon_magazine_left; } else { self.weapons[0].weapon_magazine_left = total_ammo; total_ammo = 0;