4.0.2 made land unit mobility costs differ significantly from normal

move costs, but failed to make A* use these costs.  This broke land
unit path finding.  Fix:
(MOB_ROAD, MOB_MOVE, MOB_MARCH): Split MOB_ROAD into MOB_MOVE and
MOB_MARCH.  Users changed.
(lnd_mobcost, sector_mcost): Move minimum mobcost logic to
sector_mcost(), where it is visible to A*.  Also fixes unit reaction
path cost.

(lnd_path): Fix confusing message: don't claim there's no path when
all we really know is that there's no railway.
This commit is contained in:
Markus Armbruster 2006-06-04 17:41:12 +00:00
parent 6ab05ae8a1
commit 5ad86bc7ce
11 changed files with 46 additions and 59 deletions

View file

@ -200,7 +200,7 @@ s_commod(int own, int x, int y, i_type type, int total_wanted,
continue;
if (sect.sct_effic < 60)
continue;
if (!BestLandPath(buf, &dest, &sect, &move_cost, MOB_ROAD))
if (!BestLandPath(buf, &dest, &sect, &move_cost, MOB_MOVE))
continue;
if (!opt_NOFOOD && type == I_FOOD)
minimum = 1 + (int)ceil(food_needed(sect.sct_item,
@ -273,7 +273,7 @@ s_commod(int own, int x, int y, i_type type, int total_wanted,
continue;
if (sect.sct_effic < 2)
continue;
if (!BestLandPath(buf, &dest, &sect, &move_cost, MOB_ROAD))
if (!BestLandPath(buf, &dest, &sect, &move_cost, MOB_MOVE))
continue;
if (!opt_NOFOOD && type == I_FOOD)
minimum = 1 + (int)ceil(food_needed(ship.shp_item,
@ -347,7 +347,7 @@ s_commod(int own, int x, int y, i_type type, int total_wanted,
continue;
getsect(land.lnd_x, land.lnd_y, &sect);
if (!BestLandPath(buf, &dest, &sect, &move_cost, MOB_ROAD))
if (!BestLandPath(buf, &dest, &sect, &move_cost, MOB_MOVE))
continue;
if ((land.lnd_ship >= 0) && (sect.sct_type != SCT_HARBR))