]> git.pond.sub.org Git - empserver/commitdiff
Take ship cost into account when picking missile interdiction target
authorMarkus Armbruster <armbru@pond.sub.org>
Tue, 8 Jan 2013 16:49:30 +0000 (17:49 +0100)
committerMarkus Armbruster <armbru@pond.sub.org>
Sat, 12 Jan 2013 16:56:39 +0000 (17:56 +0100)
Due to a typo, shp_missile_interdiction() picks the admissible target
with highest efficiency instead of the one with highest efficiency *
build cost.

Broken in commit cd8d7423, v4.3.8.

src/lib/subs/shpsub.c

index 66d3ec736ac8b17145548784efb8298bdfe81319..e7963f7326ed95d6190bac9ae0e62037d05cf093 100644 (file)
@@ -449,7 +449,7 @@ most_valuable_ship(struct emp_qelem *list, coord x, coord y)
            continue;
        }
        if (((struct mchrstr *)mlp->chrp)->m_cost * mlp->unit.ship.shp_effic >
-           ((struct mchrstr *)mlp->chrp)->m_cost * mvs->unit.ship.shp_effic)
+           ((struct mchrstr *)mvs->chrp)->m_cost * mvs->unit.ship.shp_effic)
            mvs = mlp;
     }
     return mvs;