Weapons will now auto-switch to the next best available weapon when empty.
This commit is contained in:
parent
1421857601
commit
5280004b1f
7 changed files with 23 additions and 6 deletions
|
@ -147,8 +147,10 @@ w_grenadelauncher_primary(player pl)
|
|||
{
|
||||
if (pl.w_attack_next > 0.0)
|
||||
return;
|
||||
if (pl.ammo_rockets <= 0)
|
||||
if (pl.ammo_rockets <= 0) {
|
||||
Weapons_SwitchBest(pl, 0);
|
||||
return;
|
||||
}
|
||||
|
||||
/* fire the actual projectile (on the server) */
|
||||
#ifdef SERVER
|
||||
|
|
|
@ -92,8 +92,10 @@ w_lightning_primary(player pl)
|
|||
{
|
||||
if (pl.w_attack_next > 0.0)
|
||||
return;
|
||||
if (pl.ammo_cells <= 0)
|
||||
if (pl.ammo_cells <= 0) {
|
||||
Weapons_SwitchBest(pl, 0);
|
||||
return;
|
||||
}
|
||||
|
||||
pl.ammo_cells--;
|
||||
|
||||
|
|
|
@ -91,8 +91,10 @@ w_nailgun_primary(player pl)
|
|||
{
|
||||
if (pl.w_attack_next > 0.0)
|
||||
return;
|
||||
if (pl.ammo_nails <= 0)
|
||||
if (pl.ammo_nails <= 0) {
|
||||
Weapons_SwitchBest(pl, 0);
|
||||
return;
|
||||
}
|
||||
|
||||
pl.ammo_nails--;
|
||||
|
||||
|
|
|
@ -92,8 +92,10 @@ w_rocketlauncher_primary(player pl)
|
|||
{
|
||||
if (pl.w_attack_next > 0.0)
|
||||
return;
|
||||
if (pl.ammo_rockets <= 0)
|
||||
if (pl.ammo_rockets <= 0) {
|
||||
Weapons_SwitchBest(pl, 0);
|
||||
return;
|
||||
}
|
||||
|
||||
/* visual fluff */
|
||||
Weapons_ViewAnimation(pl, RPG_SHOOT);
|
||||
|
|
|
@ -124,8 +124,10 @@ w_shotgun_primary(player pl)
|
|||
{
|
||||
if (pl.w_attack_next > 0.0)
|
||||
return;
|
||||
if (pl.ammo_shells <= 0)
|
||||
if (pl.ammo_shells <= 0) {
|
||||
Weapons_SwitchBest(pl, 0);
|
||||
return;
|
||||
}
|
||||
|
||||
#ifdef SERVER
|
||||
/* Singleplayer is more accurate */
|
||||
|
|
|
@ -96,6 +96,11 @@ w_supernailgun_primary(player pl)
|
|||
if (pl.w_attack_next > 0.0f)
|
||||
return;
|
||||
|
||||
if (pl.ammo_nails < 1) {
|
||||
Weapons_SwitchBest(pl, 0);
|
||||
return;
|
||||
}
|
||||
|
||||
pl.ammo_nails--;
|
||||
Weapons_ViewAnimation(pl, SUPERNAIL_SHOOT);
|
||||
Weapons_ViewPunchAngle(pl, [-2,0,0]);
|
||||
|
|
|
@ -138,8 +138,10 @@ w_supershotgun_primary(player pl)
|
|||
if (pl.w_attack_next > 0.0)
|
||||
return;
|
||||
|
||||
if (pl.ammo_shells < 2)
|
||||
if (pl.ammo_shells < 2) {
|
||||
Weapons_SwitchBest(pl, 0);
|
||||
return;
|
||||
}
|
||||
|
||||
/* actual firing */
|
||||
pl.ammo_shells -= 2;
|
||||
|
|
Loading…
Reference in a new issue