When the player declines to abandon a sector, we write back stale land
units, triggering a generation oops. Any updates made by other
threads meanwhile are wiped out, triggering a seqno mismatch oops.
The culprit is lnd_abandon_askyn(): when the player declines, it
returns without calling check_sect_ok(), check_land_ok(). Broken in
commit
7c1b166, v4.3.33. Fix it.
Signed-off-by: Markus Armbruster <armbru@pond.sub.org>
{
struct ulist *llp;
struct sctstr sect;
+ int abandon;
struct emp_qelem *qp;
if (QEMPTY(list))
return 1;
llp = (struct ulist *)list->q_back;
getsect(llp->unit.land.lnd_x, llp->unit.land.lnd_y, §);
- if (!abandon_askyn(§, I_CIVIL, 0, llp))
- return 0;
+ abandon = abandon_askyn(§, I_CIVIL, 0, llp);
if (!check_sect_ok(§))
return 0;
for (qp = list->q_back; qp != list; qp = qp->q_back) {
if (!check_land_ok(&((struct ulist *)qp)->unit.land))
return 0;
}
- return 1;
+ return abandon;
}
int
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
-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