]> git.pond.sub.org Git - empserver/commitdiff
Remove special case supply of land units from ships carrying them
authorMarkus Armbruster <armbru@pond.sub.org>
Sun, 15 Feb 2009 06:48:12 +0000 (07:48 +0100)
committerMarkus Armbruster <armbru@pond.sub.org>
Tue, 17 Feb 2009 18:30:35 +0000 (19:30 +0100)
The common supply code does not supply a land unit from the ship
carrying it, only resupply_all() does that, since 4.3.14.  It would be
nice to fix the inconsistency by always supplying land units that way,
but that's relatively costly now, because of the supply code's design.
Just drop it for now.

Affects load and lload (except resupply is disabled there because it's
buggy), supply, assault and board.

src/lib/subs/supply.c

index 6888b91b906b300d1fea98c7a865e9927e871c5f..1a10d19a85023b801e026674656386f40653feac 100644 (file)
@@ -77,29 +77,12 @@ void
 resupply_commod(struct lndstr *lp, i_type type)
 {
     int amt;
-    struct shpstr ship;
 
-    /* Ok, do we now have enough? */
     amt = get_minimum(lp, type) - lp->lnd_item[type];
     if (amt > 0) {
        lp->lnd_item[type] += supply_commod(lp->lnd_own,
                                            lp->lnd_x, lp->lnd_y,
                                            type, amt);
-       amt = get_minimum(lp, type) - lp->lnd_item[type];
-    }
-    /* Now, check again to see if we have enough. */
-    if (amt > 0) {
-       /* Are we on a ship?  if so, try to get it from the ship first. */
-       if (lp->lnd_ship >= 0) {
-           getship(lp->lnd_ship, &ship);
-           /* Now, determine how much we can get */
-           if (amt > ship.shp_item[type])
-               amt = ship.shp_item[type];
-           /* Now, add and subtract */
-           lp->lnd_item[type] += amt;
-           ship.shp_item[type] -= amt;
-           putship(lp->lnd_ship, &ship);
-       }
     }
 }