Don't unlimber when guns unsuccessfully try to fire

This happened when fire command failed becayse the gun lacked shells,
and when other ways to fire failed because the gun was inefficient,
embarked, lacked mil, guns or shells.

Broken in commit b8bdc32b, hvy-metal-2.4.
This commit is contained in:
Markus Armbruster 2008-06-27 06:53:43 -04:00
parent 2b90a5230d
commit c40dd61bf0
4 changed files with 1 additions and 4 deletions

View file

@ -349,7 +349,6 @@ multifire(void)
range2 = -1;
}
lnd_unlimber(&fland);
dam = lnd_fire(&fland);
putland(fland.lnd_uid, &fland);
if (dam < 0) {
@ -713,7 +712,6 @@ quiet_bigdef(int type, struct emp_qelem *list, natid own, natid aown,
if (fp)
dam2 = fp->defdam;
else {
lnd_unlimber(&land);
dam2 = lnd_fire(&land);
putland(land.lnd_uid, &land);
}

View file

@ -207,6 +207,7 @@ lnd_fire(struct lndstr *lp)
I_SHELL, ammo - shells);
if (shells == 0)
return -1;
lnd_unlimber(lp);
d = landunitgun(lp->lnd_effic, guns);
if (shells < ammo) {
d *= (double)shells / (double)ammo;

View file

@ -1142,7 +1142,6 @@ lnd_support(natid victim, natid attacker, coord x, coord y, int defending)
if (dist > range)
continue;
lnd_unlimber(&land);
dam2 = lnd_fire(&land);
putland(land.lnd_uid, &land);
if (dam2 < 0)

View file

@ -445,7 +445,6 @@ perform_mission(coord x, coord y, natid victim, struct emp_qelem *list,
if (md > range)
continue;
lnd_unlimber(lp);
dam2 = lnd_fire(lp);
putland(lp->lnd_uid, lp);
if (dam2 < 0)