]> git.pond.sub.org Git - empserver/commitdiff
Supply charged mobility for backward path
authorMarkus Armbruster <armbru@pond.sub.org>
Fri, 18 Feb 2011 19:05:32 +0000 (20:05 +0100)
committerMarkus Armbruster <armbru@pond.sub.org>
Mon, 11 Apr 2011 20:29:13 +0000 (22:29 +0200)
It used the path from supply recipient back to supply source.  Has
always been broken that way.

src/lib/subs/supply.c

index 4c0dba491a45c369b0b2b2ffd2eea3fb77f1866a..c1fef8c354eb51e14e2fa75327d2e59707808cc7 100644 (file)
@@ -176,7 +176,7 @@ s_commod(struct empobj *sink, short *vec,
            continue;
        if (sect.sct_effic < 60)
            continue;
-       if (!BestLandPath(buf, &dest, &sect, &move_cost, MOB_MOVE))
+       if (!BestLandPath(buf, &sect, &dest, &move_cost, MOB_MOVE))
            continue;
        if (!opt_NOFOOD && type == I_FOOD)
            minimum = 1 + (int)ceil(food_needed(sect.sct_item,
@@ -248,7 +248,7 @@ s_commod(struct empobj *sink, short *vec,
            continue;
        if (sect.sct_effic < 2)
            continue;
-       if (!BestLandPath(buf, &dest, &sect, &move_cost, MOB_MOVE))
+       if (!BestLandPath(buf, &sect, &dest, &move_cost, MOB_MOVE))
            continue;
        if (!opt_NOFOOD && type == I_FOOD)
            minimum = 1 + (int)ceil(food_needed(ship.shp_item,
@@ -322,7 +322,7 @@ s_commod(struct empobj *sink, short *vec,
            continue;
 
        getsect(land.lnd_x, land.lnd_y, &sect);
-       if (!BestLandPath(buf, &dest, &sect, &move_cost, MOB_MOVE))
+       if (!BestLandPath(buf, &sect, &dest, &move_cost, MOB_MOVE))
            continue;
 
        if ((land.lnd_ship >= 0) && (sect.sct_type != SCT_HARBR))