Weapons now respect the startammo parameter passed over their pickup function. (needed by OP4CTF)
This commit is contained in:
parent
dde42e481c
commit
6a8ac02add
12 changed files with 43 additions and 22 deletions
|
@ -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);
|
||||
|
|
|
@ -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);
|
||||
|
|
|
@ -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);
|
||||
|
|
|
@ -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);
|
||||
|
|
|
@ -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);
|
||||
|
|
|
@ -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);
|
||||
|
|
|
@ -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);
|
||||
|
|
|
@ -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);
|
||||
}
|
||||
|
||||
|
|
|
@ -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);
|
||||
|
|
|
@ -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);
|
||||
|
|
|
@ -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);
|
||||
|
|
|
@ -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);
|
||||
|
|
Loading…
Reference in a new issue