]> git.pond.sub.org Git - empserver/commitdiff
Avoid seqno mismatch oops in recursive land unit supply hvy-metal-2.3
authorMarkus Armbruster <armbru@pond.sub.org>
Wed, 28 May 2008 20:30:36 +0000 (22:30 +0200)
committerMarkus Armbruster <armbru@pike.pond.sub.org>
Wed, 28 May 2008 20:33:36 +0000 (22:33 +0200)
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.
(cherry picked from commit aacd0fb754ef060af92bb08907c5cda196bf34e3)

src/lib/subs/supply.c

index 1aa46b474b2520ba6707885809d11b1a66aa077d..ed5ae76917b34b16037dc223f7147ffed7cf5e63 100644 (file)
@@ -361,6 +361,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,