From: Markus Armbruster Date: Sat, 13 Mar 2010 21:47:13 +0000 (+0100) Subject: Fix navigate and march not to lay mines free of charge X-Git-Tag: hvy-plastic-2.2~2 X-Git-Url: http://git.pond.sub.org/?p=empserver;a=commitdiff_plain;h=03a9ab2cf6cbe3221c43a8f24836848a422b1735 Fix navigate and march not to lay mines free of charge do_unit_move() reads the ships into a list. It re-reads them when it prompts for sub-commands. shp_nav_one_sector() writes them back when it moves ships. Mine-laying (sub-command 'd') updates the minelayer, invalidating the copy in the list. Any movement sub-command before the next prompt for sub-commands wiped out this update, triggering a seno mismatch oops. Happens only if 'd' is used without arguments, because remaining sub-commands are discarded when there are arguments. Broken when mine-laying was added in commits 2438fe7c, v4.3.7. Same for march, commit 274c8e42, v4.3.7. Fix by stopping after 'd' regardless of arguments. (cherry picked from commit 28cc236e1264d57a06dfb89cf43a600ba88d271c) --- diff --git a/src/lib/commands/navi.c b/src/lib/commands/navi.c index 0213be259..745208e69 100644 --- a/src/lib/commands/navi.c +++ b/src/lib/commands/navi.c @@ -253,6 +253,7 @@ do_unit_move(struct emp_qelem *ulist, int *together, mine(); else landmine(); + stopping = 1; skip = 1; player->btused++; continue;