mirror of
https://github.com/nzp-team/quakec.git
synced 2024-11-26 05:41:20 +00:00
SERVER: Give player a clip if they have no ammo in Last Stand
This commit is contained in:
parent
bf2df6ae2f
commit
c3fa9ac216
1 changed files with 6 additions and 4 deletions
|
@ -276,10 +276,11 @@ 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
|
||||
if (total_ammo != 0)
|
||||
total_ammo -= self.weapons[0].weapon_magazine;
|
||||
} else {
|
||||
self.weapons[0].weapon_magazine = total_ammo;
|
||||
|
@ -288,10 +289,11 @@ 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
|
||||
if (total_ammo != 0)
|
||||
total_ammo -= self.weapons[0].weapon_magazine_left;
|
||||
} else {
|
||||
self.weapons[0].weapon_magazine_left = total_ammo;
|
||||
|
|
Loading…
Reference in a new issue