From 42a3c10fd9f6842007dc150768d41634c620ebea Mon Sep 17 00:00:00 2001 From: Markus Armbruster Date: Sun, 29 Nov 2015 11:30:45 +0100 Subject: [PATCH] navigate march: Fix abort not to wipe out concurrent updates When the player aborts the command at the movement prompt, we write back stale ships or land units, triggering a generation oops. Any updates made by other threads meanwhile are wiped out, triggering a seqno mismatch oops. Broken in commit 24000b4, v4.3.33. Fix by restoring the lost shp_nav_stay_behind() and lnd_mar_stay_behind() calls. Signed-off-by: Markus Armbruster --- src/lib/subs/unitsub.c | 7 +++++-- tests/navi-march/server.log | 4 ---- 2 files changed, 5 insertions(+), 6 deletions(-) diff --git a/src/lib/subs/unitsub.c b/src/lib/subs/unitsub.c index 7b903d4d..e46e9bf9 100644 --- a/src/lib/subs/unitsub.c +++ b/src/lib/subs/unitsub.c @@ -407,10 +407,13 @@ unit_move(struct emp_qelem *list) if (!*cp) { cp = unit_move_getpath(list, suppress_map, path); if (!cp) { - if (type == EF_SHIP) + if (type == EF_SHIP) { + shp_nav_stay_behind(list, player->cnum); shp_nav_put(list, player->cnum); - else + } else { + lnd_mar_stay_behind(list, player->cnum); lnd_mar_put(list, player->cnum); + } return RET_FAIL; } cp = unit_move_route(leader, path, sizeof(path)); diff --git a/tests/navi-march/server.log b/tests/navi-march/server.log index 63b14edd..b5b9382b 100644 --- a/tests/navi-march/server.log +++ b/tests/navi-march/server.log @@ -8,14 +8,10 @@ Connect from 127.0.0.1 Connect from 127.0.0.1 tester@127.0.0.1 using country #1 tester@127.0.0.1 logged in as country #1 -Oops: elt->generation != (ef_generation & 0xfff) in ../src/lib/common/file.c:699 -Crash dump complete tester@127.0.0.1 logged out, country #1 Connect from 127.0.0.1 tester@127.0.0.1 using country #1 tester@127.0.0.1 logged in as country #1 -Oops: elt->generation != (ef_generation & 0xfff) in ../src/lib/common/file.c:699 -Crash dump complete tester@127.0.0.1 logged out, country #1 Connect from 127.0.0.1 tester@127.0.0.1 using country #0