From 28d769c48e97822a4310edf3b97a776fba294531 Mon Sep 17 00:00:00 2001 From: Steam Deck User Date: Sat, 18 Mar 2023 16:23:54 -0400 Subject: [PATCH] SERVER: Have Max Ammo Power-Up function differently for Clients in Last Stand --- source/server/entities/powerups.qc | 27 +++++++++++++++++---------- 1 file changed, 17 insertions(+), 10 deletions(-) diff --git a/source/server/entities/powerups.qc b/source/server/entities/powerups.qc index 23c6011..ffbd19c 100644 --- a/source/server/entities/powerups.qc +++ b/source/server/entities/powerups.qc @@ -428,16 +428,23 @@ void() PU_MaxAmmo = tempe = find(world, classname, "player"); while(tempe) { - // Fill Primary Weapon - if (tempe.weapon) tempe.currentammo = getWeaponAmmo(tempe.weapon); - // Fill Secondary Weapon - if (tempe.secondaryweapon) tempe.secondaryammo = getWeaponAmmo(tempe.secondaryweapon); - // Fill Third Weapon - if (tempe.thirdweapon) tempe.thirdammo = getWeaponAmmo(tempe.thirdweapon); - // Give Grenades - tempe.primary_grenades = 4; - // Give Betties - if (tempe.grenades & 2) tempe.secondary_grenades = 2; + + if (!tempe.downed) { + // Fill Primary Weapon + if (tempe.weapon) tempe.currentammo = getWeaponAmmo(tempe.weapon); + // Fill Secondary Weapon + if (tempe.secondaryweapon) tempe.secondaryammo = getWeaponAmmo(tempe.secondaryweapon); + // Fill Third Weapon + if (tempe.thirdweapon) tempe.thirdammo = getWeaponAmmo(tempe.thirdweapon); + // Give Grenades + tempe.primary_grenades = 4; + // Give Betties + if (tempe.grenades & 2) tempe.secondary_grenades = 2; + } else { + // Reset shots fired, fill 2 mags into reserve. + tempe.teslacount = 0; + tempe.currentammo = getWeaponMag(tempe.weapon) * 2; + } // MAX AMMO! text