diff options
author | matthijs <matthijs@openttd.org> | 2005-07-03 13:02:54 +0000 |
---|---|---|
committer | matthijs <matthijs@openttd.org> | 2005-07-03 13:02:54 +0000 |
commit | fb8e5f61b181ca34c43d0a0e8d39ee95af2eb60a (patch) | |
tree | 6d371024326a8ed726a5b94394047c888bd1a2c8 /roadveh_cmd.c | |
parent | 6df35235d5b610262af8777cf2047245d271e5c9 (diff) | |
download | openttd-fb8e5f61b181ca34c43d0a0e8d39ee95af2eb60a.tar.xz |
(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)
Diffstat (limited to 'roadveh_cmd.c')
-rw-r--r-- | roadveh_cmd.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/roadveh_cmd.c b/roadveh_cmd.c index f28002cd2..1796d1a32 100644 --- a/roadveh_cmd.c +++ b/roadveh_cmd.c @@ -304,7 +304,7 @@ static Depot *FindClosestRoadDepot(Vehicle *v) /* See where we are now */ Trackdir trackdir = GetVehicleTrackdir(v); - ftd = NPFRouteToDepotBreadthFirst(v->tile, trackdir, TRANSPORT_ROAD, v->owner); + ftd = NPFRouteToDepotBreadthFirst(v->tile, trackdir, TRANSPORT_ROAD, v->owner, INVALID_RAILTYPE); if (ftd.best_bird_dist == 0) return GetDepotByTile(ftd.node.tile); /* Target found */ else @@ -1086,7 +1086,7 @@ static int RoadFindPathToDest(Vehicle *v, TileIndex tile, int enterdir) trackdir = DiagdirToDiagTrackdir(enterdir); //debug("Finding path. Enterdir: %d, Trackdir: %d", enterdir, trackdir); - ftd = NPFRouteToStationOrTile(tile - TileOffsByDir(enterdir), trackdir, &fstd, TRANSPORT_ROAD, v->owner); + ftd = NPFRouteToStationOrTile(tile - TileOffsByDir(enterdir), trackdir, &fstd, TRANSPORT_ROAD, v->owner, INVALID_RAILTYPE); if (ftd.best_trackdir == 0xff) { /* We are already at our target. Just do something */ //TODO: maybe display error? @@ -1163,7 +1163,7 @@ static uint RoadFindPathToStation(const Vehicle *v, TileIndex tile) fstd.dest_coords = tile; fstd.station_index = -1; // indicates that the destination is a tile, not a station - return NPFRouteToStationOrTile(v->tile, trackdir, &fstd, TRANSPORT_ROAD, v->owner).best_path_dist; + return NPFRouteToStationOrTile(v->tile, trackdir, &fstd, TRANSPORT_ROAD, v->owner, INVALID_RAILTYPE).best_path_dist; } typedef struct RoadDriveEntry { |