]> git.pond.sub.org Git - empserver/commitdiff
Disable incorrect autmatic supply in load and lload
authorMarkus Armbruster <armbru@pond.sub.org>
Sat, 20 Sep 2008 13:16:46 +0000 (09:16 -0400)
committerMarkus Armbruster <armbru@pond.sub.org>
Sat, 20 Sep 2008 13:16:46 +0000 (09:16 -0400)
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.  Disable for now.

src/lib/commands/load.c

index cb35f10844aa45ded0bfd888700a9eebe255e966..625c0237e9c94d07095733596163639b070d4bca 100644 (file)
@@ -594,7 +594,14 @@ load_land_ship(struct sctstr *sectp, struct shpstr *sp, int noisy,
            gift(sp->shp_own, player->cnum, &land, buf);
            land.lnd_ship = sp->shp_uid;
            land.lnd_harden = 0;
            gift(sp->shp_own, player->cnum, &land, buf);
            land.lnd_ship = sp->shp_uid;
            land.lnd_harden = 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);
            resupply_all(&land);
+#endif
            putland(land.lnd_uid, &land);
            if (!has_supply(&land))
                pr("WARNING: %s is out of supply!\n", prland(&land));
            putland(land.lnd_uid, &land);
            if (!has_supply(&land))
                pr("WARNING: %s is out of supply!\n", prland(&land));
@@ -988,7 +995,10 @@ load_land_land(struct sctstr *sectp, struct lndstr *lp, int noisy,
            gift(lp->lnd_own, player->cnum, &land, buf);
            land.lnd_land = lp->lnd_uid;
            land.lnd_harden = 0;
            gift(lp->lnd_own, player->cnum, &land, buf);
            land.lnd_land = lp->lnd_uid;
            land.lnd_harden = 0;
+#if 0
+           /* FIXME same issue as in load_land_ship() */
            resupply_all(&land);
            resupply_all(&land);
+#endif
            putland(land.lnd_uid, &land);
            if (!has_supply(&land))
                pr("WARNING: %s is out of supply!\n", prland(&land));
            putland(land.lnd_uid, &land);
            if (!has_supply(&land))
                pr("WARNING: %s is out of supply!\n", prland(&land));