From aacd0fb754ef060af92bb08907c5cda196bf34e3 Mon Sep 17 00:00:00 2001 From: Markus Armbruster Date: Wed, 28 May 2008 22:30:36 +0200 Subject: [PATCH] Avoid seqno mismatch oops in recursive land unit supply Before s_commod() attempts to recursively supply a supply unit it wants to use as supply source, it zaps the unit's load. When actually_doit is false, it later restores the old load by overwriting the change with a saved copy of the unit. That triggers a seqno mismatch oops. Avoid that by copying the new sequence number to the saved copy. --- src/lib/subs/supply.c | 1 + 1 file changed, 1 insertion(+) diff --git a/src/lib/subs/supply.c b/src/lib/subs/supply.c index dcff9455..436248d7 100644 --- a/src/lib/subs/supply.c +++ b/src/lib/subs/supply.c @@ -346,6 +346,7 @@ s_commod(int own, int x, int y, i_type type, int total_wanted, save = land; land.lnd_item[type] = 0; putland(land.lnd_uid, &land); + save.lnd_seqno = land.lnd_seqno; land.lnd_item[type] = save.lnd_item[type] + s_commod(own, land.lnd_x, land.lnd_y,