]> git.pond.sub.org Git - empserver/commitdiff
Fix unlimbering, it had no effect
authorMarkus Armbruster <armbru@pond.sub.org>
Tue, 10 Jun 2008 05:29:04 +0000 (07:29 +0200)
committerMarkus Armbruster <armbru@pike.pond.sub.org>
Tue, 10 Jun 2008 08:24:59 +0000 (10:24 +0200)
Broken by mismerging the rebase of Hvy Metal I in commit 5d0f5e69,
except for fire command when the target was out of range.

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

index 68677b4988c6f32295b12e28d2c404d72cc76cd2..d277727b725925efe2d4ddf21698854ba4b70a1c 100644 (file)
@@ -349,6 +349,7 @@ multifire(void)
                range2 = -1;
            }
 
+           lnd_unlimber(&fland);
            dam = lnd_fire(&fland);
            putland(fland.lnd_uid, &fland);
            if (dam < 0) {
@@ -356,7 +357,6 @@ multifire(void)
                continue;
            }
 
-           lnd_unlimber(&fland);
            if (target == targ_ship) {
                if (chance(lnd_acc(&fland) / 100.0))
                    dam = ldround(dam / 2.0, 1);
@@ -713,13 +713,13 @@ 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);
        }
        if (dam2 < 0)
            continue;
 
-       lnd_unlimber(&land);
        (*nfiring)++;
        if (!fp)
            add_to_flist(list, (struct empobj *)&land, dam2, 0);
index 578c1af0a8d038455a2aa94df6ec8154b79eeed2..62cfd82166c2e52403033ac297f7e86abd61f72b 100644 (file)
@@ -1142,12 +1142,12 @@ 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)
            continue;
 
-       lnd_unlimber(&land);
        if (defending)
            nreport(land.lnd_own, N_FIRE_BACK, victim, 1);
        else
index 340f2f570fc857efb86338cce127c08802ddb893..129448c10853a0fda6ecbf118b8940fd678141a4 100644 (file)
@@ -444,12 +444,12 @@ 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)
                continue;
 
-           lnd_unlimber(lp);
            if (sect.sct_type == SCT_WATER) {
                if (chance(lnd_acc(lp) / 100.0))
                    dam2 = ldround(dam2 / 2.0, 1);