From e03eaeae23b8b6bc37f4c434f37652ca8c13d0b5 Mon Sep 17 00:00:00 2001 From: Markus Armbruster Date: Sun, 8 Mar 2009 11:54:04 +0100 Subject: [PATCH] Fix a bug in attack that could wipe out land unit updates A victorious attacker can move attacking land units into the newly conquered sector or leave them behind. Normally, the player is asked what to do, but when the land unit's army has already been told to stay behind, or the command has been aborted, the land unit stays behind without asking. In that case, a copy of the land unit made right after the victory was written back. Any updates since the victory were wiped out, triggering a seqno mismatch oops. Fix by moving the re-read of the land unit in ask_move_in() out of the prompt conditional. --- src/lib/subs/attsub.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/lib/subs/attsub.c b/src/lib/subs/attsub.c index ca8680113..64b462bdc 100644 --- a/src/lib/subs/attsub.c +++ b/src/lib/subs/attsub.c @@ -2288,9 +2288,9 @@ ask_move_in(struct combat *off, struct emp_qelem *olist, *answerp = 'N'; if (*answerp == 'Y') continue; + if (!get_land(A_ATTACK, def, llp->unit.land.lnd_uid, llp, 0)) + continue; if (*answerp != 'N') { - if (!get_land(A_ATTACK, def, llp->unit.land.lnd_uid, llp, 0)) - continue; sprintf(prompt, "Move in with %s (%c %d%%) [ynYNq?] ", prland(&llp->unit.land), llp->unit.land.lnd_army ? llp->unit.land.lnd_army : '~', -- 2.43.0