From 47430cc885dc13cfa13861df1238ba1d98a18378 Mon Sep 17 00:00:00 2001 From: Markus Armbruster Date: Mon, 12 May 2008 17:22:39 +0200 Subject: [PATCH] Disable incorrect use of resupply_all() in load and lload 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 | 6 ++++-- src/lib/commands/load.c | 10 ++++++++++ 2 files changed, 14 insertions(+), 2 deletions(-) diff --git a/info/Hvy-Metal.t b/info/Hvy-Metal.t index beb74cdb8..4d6ca557f 100644 --- a/info/Hvy-Metal.t +++ b/info/Hvy-Metal.t @@ -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. diff --git a/src/lib/commands/load.c b/src/lib/commands/load.c index b677d3ead..67f9b60e1 100644 --- a/src/lib/commands/load.c +++ b/src/lib/commands/load.c @@ -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)) -- 2.43.0