]> git.pond.sub.org Git - empserver/commitdiff
Don't unlimber when guns unsuccessfully try to fire hvy-metal-2.6
authorMarkus Armbruster <armbru@pond.sub.org>
Fri, 27 Jun 2008 10:53:43 +0000 (06:53 -0400)
committerMarkus Armbruster <armbru@pond.sub.org>
Fri, 27 Jun 2008 10:53:43 +0000 (06:53 -0400)
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.

src/lib/commands/mfir.c
src/lib/subs/landgun.c
src/lib/subs/lndsub.c
src/lib/subs/mission.c

index d277727b725925efe2d4ddf21698854ba4b70a1c..5c65583ce0dcb6a6a3e2a3ee28828dbc36fa9628 100644 (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);
        }
index a6a21da9e275cc94f7086d7babbb012e853d976f..160b403d517d35c6bd1442d19b41616b71e1fe3d 100644 (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;
index 62cfd82166c2e52403033ac297f7e86abd61f72b..12f8ecc7f22466011628ce74f611776c02ba2d5d 100644 (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)
index f4d1bf13e6b79488951ba0869399bf4a74877d2e..2f147f471e2683317155a1735e1eabb75a09bd7a 100644 (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)