]> git.pond.sub.org Git - empserver/commitdiff
bomb: Fix damage to mobility when bombing planes
authorMarkus Armbruster <armbru@pond.sub.org>
Sun, 1 Feb 2015 16:24:51 +0000 (17:24 +0100)
committerMarkus Armbruster <armbru@pond.sub.org>
Mon, 2 Mar 2015 07:20:51 +0000 (08:20 +0100)
A bombed plane's mobility is multiplied by dam/100.0, i.e. the higher
the damage, the lower the mobility loss.  Has always been broken.  Fix
by computing the new mobility with damage(), like we do elsewhere.

Signed-off-by: Markus Armbruster <armbru@pond.sub.org>
src/lib/commands/bomb.c

index 38487f502969953d63dc3b26a204d5225e0edc23..d44d7d7d61144f3d02c4edf7cc1dffbc2d6cc4d7 100644 (file)
@@ -570,7 +570,7 @@ plane_bomb(struct emp_qelem *list, struct sctstr *target)
            plane.pln_effic = 0;
        else
            plane.pln_effic -= dam;
-       plane.pln_mobil = (dam * plane.pln_mobil / 100.0);
+       plane.pln_mobil = damage(plane.pln_mobil, dam);
        mpr(own, "%s bombs did %d%% damage to %s at %s\n",
               cname(player->cnum), dam, prplane(&plane),
               xyas(target->sct_x, target->sct_y, own));