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>
This commit is contained in:
Markus Armbruster 2016-07-24 16:10:41 +02:00
parent 3a1f240dc4
commit 44d4a1c7ff

View file

@ -213,6 +213,7 @@ lnd_take_casualty(int combat_mode, struct ulist *llp, int cas)
ret_chance = llp->unit.land.lnd_retreat - llp->unit.land.lnd_effic;
if (pct_chance(ret_chance)) {
if (llp->unit.land.lnd_own == player->cnum)
pr("\n");
lnd_print(llp->unit.land.lnd_own, llp, "fails morale check!");
llp->unit.land.lnd_mission = 0;