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>
ret_chance = llp->unit.land.lnd_retreat - llp->unit.land.lnd_effic;
if (pct_chance(ret_chance)) {
- pr("\n");
+ 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;
llp->unit.land.lnd_harden = 0;