]> git.pond.sub.org Git - empserver/commitdiff
navigate march: Fix abort not to wipe out concurrent updates
authorMarkus Armbruster <armbru@pond.sub.org>
Sun, 29 Nov 2015 10:30:45 +0000 (11:30 +0100)
committerMarkus Armbruster <armbru@pond.sub.org>
Sat, 5 Dec 2015 12:19:39 +0000 (13:19 +0100)
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 <armbru@pond.sub.org>
src/lib/subs/unitsub.c
tests/navi-march/server.log

index 7b903d4dd9b18acf4dc523df22634050eba0eb71..e46e9bf947d6308b0fdae8b720f68ee79afae6a6 100644 (file)
@@ -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));
index 63b14eddce1d5066b22f04afd6c8e6275d4b68b0..b5b9382b35987a01775dbd8206905c69e767c315 100644 (file)
@@ -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