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:
parent
6ab05ae8a1
commit
5ad86bc7ce
11 changed files with 46 additions and 59 deletions
|
@ -100,7 +100,7 @@ deliver(struct sctstr *from, struct ichrstr *ip, int dir,
|
|||
* calculate unit movement cost; decrease amount if
|
||||
* there isn't enough mobility.
|
||||
*/
|
||||
mcost = sector_mcost(to, MOB_ROAD) * ip->i_lbs / ip->i_pkg[packing];
|
||||
mcost = sector_mcost(to, MOB_MOVE) * ip->i_lbs / ip->i_pkg[packing];
|
||||
mcost /= DELIVER_BONUS;
|
||||
|
||||
if (mobility < mcost * amt_moved) {
|
||||
|
|
|
@ -220,7 +220,7 @@ assemble_dist_paths(struct distinfo *distptrs)
|
|||
p = ReversePath(path);
|
||||
/* And walk the path back to the dist center to get the export
|
||||
cost */
|
||||
infptr->excost = pathcost(sp, p, MOB_ROAD);
|
||||
infptr->excost = pathcost(sp, p, MOB_MOVE);
|
||||
#ifdef SAVE_FINISH_PATHS
|
||||
memcpy(infptr->path, p, len);
|
||||
#else
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue