]> git.pond.sub.org Git - empserver/commitdiff
Disable incorrect use of resupply_all() in load and lload
authorMarkus Armbruster <armbru@pond.sub.org>
Mon, 12 May 2008 15:22:39 +0000 (17:22 +0200)
committerMarkus Armbruster <armbru@pond.sub.org>
Mon, 12 May 2008 15:22:39 +0000 (17:22 +0200)
load_land_ship() and load_land_land() automatically resupply the land
units they load.  This can draw supplies from the sector where the
land units are.  When load() and lload() later update the sector, they
wipe out the update made for drawing supplies, and we get a seqno
mismatch oops.  Highly abusable.

info/Hvy-Metal.t
src/lib/commands/load.c

index beb74cdb8f846632dd60c39236601e9886002018..4d6ca557f29115e8d8ac591239f33f3fdad58d49 100644 (file)
@@ -99,8 +99,10 @@ conserve oil.  Resources are scarce.  Expect to fight over them.
 Oil derricks need to set up shop before they produce: no production
 while mobility is below maximum.
 .s1
-Automatic shell supply for sector flak and ship missile defense is
-disabled, because its bugs interfere with Hvy Metal modifications.
+Automatic shell supply for sector flak, ship flak and ship missile
+defense is disabled, because its bugs interfere with Hvy Metal
+modifications.  Same for automatic supply of land units on loading
+them onto ships or land units.
 .s1
 Missed updates due to server problems will be forced if caught within
 15 minutes of planned update time or skipped otherwise.
index b677d3eaddb520ecafdcfc881f529867962c3d61..67f9b60e1c38f1a4ce159fcc5fde48cc80e68af5 100644 (file)
@@ -603,7 +603,14 @@ load_land_ship(struct sctstr *sectp, struct shpstr *sp, int noisy,
            land.lnd_ship = sp->shp_uid;
            land.lnd_harden = 0;
            land.lnd_mission = 0;
+#if 0
+           /*
+            * FIXME if this supplies from the sector, the putsect in
+            * load() / lload() duplicates those supplies, causing a
+            * seqno mismatch
+            */
            resupply_all(&land);
+#endif
            sp->shp_nland++;
            putland(land.lnd_uid, &land);
            if (!has_supply(&land))
@@ -1034,7 +1041,10 @@ load_land_land(struct sctstr *sectp, struct lndstr *lp, int noisy,
            land.lnd_land = lp->lnd_uid;
            land.lnd_harden = 0;
            land.lnd_mission = 0;
+#if 0
+           /* FIXME same issue as in load_land_ship() */
            resupply_all(&land);
+#endif
            lp->lnd_nland++;
            putland(land.lnd_uid, &land);
            if (!has_supply(&land))