]> git.pond.sub.org Git - empserver/commit
attack assault paradrop: Don't disclose defender's retreats
authorMarkus Armbruster <armbru@pond.sub.org>
Sun, 24 Jul 2016 14:10:41 +0000 (16:10 +0200)
committerMarkus Armbruster <armbru@pond.sub.org>
Sun, 6 Aug 2017 18:09:19 +0000 (20:09 +0200)
commit44d4a1c7ff00d05651f3ec1c1ebcae9d33c0e8aa
treeab908250524f335509392e26b25c619c69718ec3
parent3a1f240dc4d0f0c65cc76cdf72c98601c15681d4
attack assault paradrop: Don't disclose defender's retreats

When an attacking land unit fails its morale check and retreats, the
retreat message needs to be prefixed with a newline to separate it
from the casualty characters.  However, the code also prints the
newline when a defending land unit retreats, leaking the retreat to
the attacker.  For instance, a fight that forces three defending to
retreat could look like this:

    !!!!!!!!!!!!!!!!!!
    !@!!!!!!!!!!!!!@!
    !

    - Casualties -
 Yours: 2
Theirs: 34

Messed up in Empire 3.  Fix by printing the newline only when an
attacking land unit retreats.  The example becomes:

    !!!!!!!!!!!!!!!!!!!@!!!!!!!!!!!!!@!!
    - Casualties -
 Yours: 2
Theirs: 34

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