(M_TORP_SHELLS): New.

(perform_mission, torp, fire_torp, quiet_bigdef, use_ammo): Use it.
Closes #917459.
This commit is contained in:
Markus Armbruster 2004-05-09 20:55:30 +00:00
parent a6bd408323
commit d7e697b1f9
4 changed files with 26 additions and 24 deletions

View file

@ -811,10 +811,10 @@ quiet_bigdef(int attacker, struct emp_qelem *list, natid own, natid aown,
continue;
if (mchr[(int)ship.shp_type].m_flags & M_SUB) {
if (shell < 3)
if (shell < M_TORP_SHELLS)
shell += supply_commod(ship.shp_own, ship.shp_x, ship.shp_y,
I_SHELL, 3 - shell);
if (shell < 3)
I_SHELL, M_TORP_SHELLS - shell);
if (shell < M_TORP_SHELLS)
continue;
if (gun < 1)
continue;
@ -1008,7 +1008,7 @@ use_ammo(struct emp_qelem *list)
item = ship.shp_item;
if (mchr[(int)ship.shp_type].m_flags & M_SUB) {
shell = item[I_SHELL];
shell--;
shell -= M_TORP_SHELLS - 1;
if (shell < 0)
shell = 0;
item[I_SHELL] = shell;