diff --git a/src/shared/w_crossbow.qc b/src/shared/w_crossbow.qc index f2c26d2..19cb3a0 100644 --- a/src/shared/w_crossbow.qc +++ b/src/shared/w_crossbow.qc @@ -75,13 +75,15 @@ int w_crossbow_pickup(player pl, int new, int startammo) { #ifdef SERVER + int addAmmo = (startammo == -1) ? 5 : startammo; + if (new) { - pl.crossbow_mag = 5; + pl.crossbow_mag = addAmmo; return (1); } if (pl.ammo_bolt < MAX_A_BOLT) { - pl.ammo_bolt = bound(0, pl.ammo_bolt + 5, MAX_A_BOLT); + pl.ammo_bolt = bound(0, pl.ammo_bolt + addAmmo, MAX_A_BOLT); } else { if (!new) return (0); diff --git a/src/shared/w_egon.qc b/src/shared/w_egon.qc index 4a87d60..a811ca7 100644 --- a/src/shared/w_egon.qc +++ b/src/shared/w_egon.qc @@ -83,8 +83,10 @@ string w_egon_deathmsg(void) int w_egon_pickup(player pl, int new, int startammo) { #ifdef SERVER + int addAmmo = (startammo == -1) ? 20 : startammo; + if (pl.ammo_uranium < MAX_A_URANIUM) { - pl.ammo_uranium = bound(0, pl.ammo_uranium + 20, MAX_A_URANIUM); + pl.ammo_uranium = bound(0, pl.ammo_uranium + addAmmo, MAX_A_URANIUM); } else { if (!new) return (0); diff --git a/src/shared/w_gauss.qc b/src/shared/w_gauss.qc index b14adf5..f8c00a9 100644 --- a/src/shared/w_gauss.qc +++ b/src/shared/w_gauss.qc @@ -75,9 +75,10 @@ string w_gauss_deathmsg(void) int w_gauss_pickup(player pl, int new, int startammo) { #ifdef SERVER + int addAmmo = (startammo == -1) ? 20 : startammo; if (pl.ammo_uranium < MAX_A_URANIUM) { - pl.ammo_uranium = bound(0, pl.ammo_uranium + 20, MAX_A_URANIUM); + pl.ammo_uranium = bound(0, pl.ammo_uranium + addAmmo, MAX_A_URANIUM); } else { if (!new) return (0); diff --git a/src/shared/w_glock.qc b/src/shared/w_glock.qc index b5959ac..c5a2b1b 100644 --- a/src/shared/w_glock.qc +++ b/src/shared/w_glock.qc @@ -103,13 +103,15 @@ int w_glock_pickup(player pl, int new, int startammo) { #ifdef SERVER + int addAmmo = (startammo == -1) ? 18 : startammo; + if (new) { - pl.glock_mag = 18; + pl.glock_mag = addAmmo; return (1); } if (pl.ammo_9mm < MAX_A_9MM) { - pl.ammo_9mm = bound(0, pl.ammo_9mm + 18, MAX_A_9MM); + pl.ammo_9mm = bound(0, pl.ammo_9mm + addAmmo, MAX_A_9MM); } else { if (!new) return (0); diff --git a/src/shared/w_handgrenade.qc b/src/shared/w_handgrenade.qc index 3583ec7..186267e 100644 --- a/src/shared/w_handgrenade.qc +++ b/src/shared/w_handgrenade.qc @@ -60,9 +60,10 @@ string w_handgrenade_deathmsg(void) int w_handgrenade_pickup(player pl, int new, int startammo) { #ifdef SERVER + int addAmmo = (startammo == -1) ? 1 : startammo; if (pl.ammo_handgrenade < MAX_A_HANDGRENADE) { - pl.ammo_handgrenade = bound(0, pl.ammo_handgrenade + 1, MAX_A_HANDGRENADE); + pl.ammo_handgrenade = bound(0, pl.ammo_handgrenade + addAmmo, MAX_A_HANDGRENADE); } else { if (!new) return (0); diff --git a/src/shared/w_mp5.qc b/src/shared/w_mp5.qc index 48360d2..a9648fc 100644 --- a/src/shared/w_mp5.qc +++ b/src/shared/w_mp5.qc @@ -82,17 +82,19 @@ int w_mp5_pickup(player pl, int new, int startammo) { #ifdef SERVER +#ifdef GEARBOX + int addAmmo = (startammo == -1) ? 50 : startammo; +#else + int addAmmo = (startammo == -1) ? 25 : startammo; +#endif + if (new) { - #ifdef GEARBOX - pl.mp5_mag = 50; - #else - pl.mp5_mag = 25; - #endif + pl.mp5_mag = addAmmo; return (1); } if (pl.ammo_9mm < MAX_A_9MM) { - pl.ammo_9mm = bound(0, pl.ammo_9mm + 25, MAX_A_9MM); + pl.ammo_9mm = bound(0, pl.ammo_9mm + addAmmo, MAX_A_9MM); } else { if (!new) return (0); diff --git a/src/shared/w_python.qc b/src/shared/w_python.qc index 0dcf520..c8479a2 100644 --- a/src/shared/w_python.qc +++ b/src/shared/w_python.qc @@ -44,14 +44,15 @@ int w_python_pickup(player pl, int new, int startammo) { #ifdef SERVER + int addAmmo = (startammo == -1) ? 6 : startammo; if (new) { - pl.python_mag = 6; + pl.python_mag = addAmmo; return (1); } if (pl.ammo_357 < MAX_A_357) { - pl.ammo_357 = bound(0, pl.ammo_357 + 6, MAX_A_357); + pl.ammo_357 = bound(0, pl.ammo_357 + addAmmo, MAX_A_357); } else { if (!new) return (0); diff --git a/src/shared/w_rpg.qc b/src/shared/w_rpg.qc index 7dccd59..6553c67 100644 --- a/src/shared/w_rpg.qc +++ b/src/shared/w_rpg.qc @@ -62,10 +62,15 @@ string w_rpg_deathmsg(void) int w_rpg_pickup(player pl, int new, int startammo) { #ifdef SERVER + int addAmmo = (startammo == -1) ? 2 : startammo; if (new) { - pl.rpg_mag = 1; - pl.ammo_rocket = bound(0, pl.ammo_rocket + 1, MAX_A_ROCKET); + if (addAmmo > 1) { + pl.rpg_mag = 1; + pl.ammo_rocket = bound(0, pl.ammo_rocket + 1, MAX_A_ROCKET); + } else { + pl.rpg_mag = addAmmo; + } return (1); } diff --git a/src/shared/w_satchel.qc b/src/shared/w_satchel.qc index 633828c..dc03840 100644 --- a/src/shared/w_satchel.qc +++ b/src/shared/w_satchel.qc @@ -116,9 +116,10 @@ int w_satchel_pickup(player pl, int new, int startammo) { #ifdef SERVER + int addAmmo = (startammo == -1) ? 1 : startammo; if (pl.ammo_satchel < MAX_A_SATCHEL) { - pl.ammo_satchel = bound(0, pl.ammo_satchel + 1, MAX_A_SATCHEL); + pl.ammo_satchel = bound(0, pl.ammo_satchel + addAmmo, MAX_A_SATCHEL); } else { if (!new) return (0); diff --git a/src/shared/w_shotgun.qc b/src/shared/w_shotgun.qc index 4eac0c9..77068df 100644 --- a/src/shared/w_shotgun.qc +++ b/src/shared/w_shotgun.qc @@ -115,13 +115,15 @@ int w_shotgun_pickup(player pl, int new, int startammo) { #ifdef SERVER + int addAmmo = (startammo == -1) ? 8 : startammo; + if (new) { - pl.shotgun_mag = 8; + pl.shotgun_mag = addAmmo; return (1); } if (pl.ammo_buckshot < MAX_A_BUCKSHOT) { - pl.ammo_buckshot = bound(0, pl.ammo_buckshot + 8, MAX_A_BUCKSHOT); + pl.ammo_buckshot = bound(0, pl.ammo_buckshot + addAmmo, MAX_A_BUCKSHOT); } else { if (!new) return (0); diff --git a/src/shared/w_snark.qc b/src/shared/w_snark.qc index 7409e74..5265ed2 100644 --- a/src/shared/w_snark.qc +++ b/src/shared/w_snark.qc @@ -147,9 +147,10 @@ monster_snark::monster_snark(void) int w_snark_pickup(player pl, int new, int startammo) { #ifdef SERVER + int addAmmo = (startammo == -1) ? 5 : startammo; if (pl.ammo_snark < MAX_A_SNARK) { - pl.ammo_snark = bound(0, pl.ammo_snark + 5, MAX_A_SNARK); + pl.ammo_snark = bound(0, pl.ammo_snark + addAmmo, MAX_A_SNARK); } else { if (!new) return (0); diff --git a/src/shared/w_tripmine.qc b/src/shared/w_tripmine.qc index 1923d8d..9215acf 100644 --- a/src/shared/w_tripmine.qc +++ b/src/shared/w_tripmine.qc @@ -226,9 +226,10 @@ string w_tripmine_deathmsg(void) int w_tripmine_pickup(player pl, int new, int startammo) { #ifdef SERVER + int addAmmo = (startammo == -1) ? 1 : startammo; if (pl.ammo_tripmine < MAX_A_TRIPMINE) { - pl.ammo_tripmine = bound(0, pl.ammo_tripmine + 1, MAX_A_TRIPMINE); + pl.ammo_tripmine = bound(0, pl.ammo_tripmine + addAmmo, MAX_A_TRIPMINE); } else { if (!new) return (0);