]> git.pond.sub.org Git - empserver/commitdiff
attack assault board: Fix message when attacking land unit dies
authorMarkus Armbruster <armbru@pond.sub.org>
Sun, 24 Jul 2016 13:08:14 +0000 (15:08 +0200)
committerMarkus Armbruster <armbru@pond.sub.org>
Sun, 6 Aug 2017 18:09:19 +0000 (20:09 +0200)
Loss of an attacking land is reported like this:

    @linf light infantry #1 dies assault 21,-3!

Bad grammar and newline missing between the "@" casualty character and
the message.  Messed up in Empire 2.  Affects only attackers, because
the code special-cases defense to avoid the bad grammar there (close,
but no cigar), and defenders don't get casualty characters printed.
Fix it to

    @
    linf light infantry #1 dies assaulting 21,-3!

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

index 65ecbe2d5aa3bf7cb28a245680fb3d55561ad498..29131466b455bab984cb1baf2023e455ddc1ca8b 100644 (file)
@@ -183,8 +183,10 @@ lnd_take_casualty(int combat_mode, struct ulist *llp, int cas)
     lnd_submil(&llp->unit.land, cas);
 
     if (llp->unit.land.lnd_effic < LAND_MINEFF) {
-       sprintf(buf, "dies %s %s!",
-               combat_mode ? att_mode[combat_mode] : "defending",
+       if (llp->unit.land.lnd_own == player->cnum)
+           pr("\n");
+       sprintf(buf, "dies %sing %s!",
+               att_mode[combat_mode],
                xyas(llp->unit.land.lnd_x, llp->unit.land.lnd_y,
                     llp->unit.land.lnd_own));
        lnd_print(llp->unit.land.lnd_own, llp, buf);