1
0
mirror of https://github.com/OpenTTD/OpenTTD.git synced 2025-08-20 13:09:15 +00:00

(svn r2514) - Codechange: [NPF] Move the checking of railtype into a funciton IsCompatibleRail().

- Codechange: [NPF] Check the railtype along a route against the engine type instead of against the previouse tile. This clears the way for electriefied rails.
- Add: [NPF] [ 1209644 ] A penalty for crossings (peter1138)
This commit is contained in:
matthijs
2005-07-03 13:02:54 +00:00
parent 6df35235d5
commit fb8e5f61b1
11 changed files with 58 additions and 37 deletions

View File

@@ -65,7 +65,7 @@ static Depot *FindClosestShipDepot(Vehicle *v)
if (_patches.new_pathfinding_all) {
NPFFoundTargetData ftd;
byte trackdir = GetVehicleTrackdir(v);
ftd = NPFRouteToDepotTrialError(v->tile, trackdir, TRANSPORT_WATER, v->owner);
ftd = NPFRouteToDepotTrialError(v->tile, trackdir, TRANSPORT_WATER, v->owner, INVALID_RAILTYPE);
if (ftd.best_bird_dist == 0)
best_depot = GetDepotByTile(ftd.node.tile); /* Found target */
else
@@ -565,7 +565,7 @@ static int ChooseShipTrack(Vehicle *v, TileIndex tile, int enterdir, uint tracks
NPFFillWithOrderData(&fstd, v);
ftd = NPFRouteToStationOrTile(src_tile, trackdir, &fstd, TRANSPORT_WATER, v->owner);
ftd = NPFRouteToStationOrTile(src_tile, trackdir, &fstd, TRANSPORT_WATER, v->owner, INVALID_RAILTYPE);
if (ftd.best_trackdir != 0xff)
/* If ftd.best_bird_dist is 0, we found our target and ftd.best_trackdir contains