SERVER: Fix improper handling of ammunition used in Last Stand

fixes infinite ammo bug :p
This commit is contained in:
Steam Deck User 2023-02-07 13:19:52 -05:00
parent 11f4d470c8
commit 578fa2d44e

View file

@ -345,11 +345,24 @@ void () GetUp =
self.classname = "player";
// Take away the ammo that was fired while in last stand.
if (self.weapon == self.weaponbk) {
self.currentammobk -= self.teslacount;
} else if (self.weapon == self.secondaryweapon) {
self.secondaryammo -= self.teslacount;
if (self.weapon != W_COLT) {
if (self.weapon == self.weaponbk) {
self.currentammobk -= self.teslacount;
// Take from the mag if the reserve is empty now
if (self.currentammobk < 0)
self.currentmagbk += self.currentammobk;
self.currentammobk = 0;
} else if (self.weapon == self.secondaryweapon) {
self.secondaryammo -= self.teslacount;
// Take from the mag if the reserve is empty now
if (self.secondaryammo < 0)
self.secondarymag += self.secondaryammo;
self.secondaryammo = 0;
}
}
self.teslacount = 0;
if (!coop) {