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