summaryrefslogtreecommitdiff
path: root/src/pathfinder/npf
diff options
context:
space:
mode:
authorrubidium <rubidium@openttd.org>2009-12-02 14:41:04 +0000
committerrubidium <rubidium@openttd.org>2009-12-02 14:41:04 +0000
commita1e28925e3c974a3c34a609737677ca072c559e1 (patch)
treed860a470be11edcd7eabdbe42134c584322251ee /src/pathfinder/npf
parentf67c265c6f5c88d5f9d18a831da5b65329169712 (diff)
downloadopenttd-a1e28925e3c974a3c34a609737677ca072c559e1.tar.xz
(svn r18375) -Codechange: use Station::GetTileArea to get the tile area for CalcClosestStationTile
Diffstat (limited to 'src/pathfinder/npf')
-rw-r--r--src/pathfinder/npf/npf.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/pathfinder/npf/npf.cpp b/src/pathfinder/npf/npf.cpp
index 38c966cfd..d444d779b 100644
--- a/src/pathfinder/npf/npf.cpp
+++ b/src/pathfinder/npf/npf.cpp
@@ -105,7 +105,7 @@ static int32 NPFCalcStationOrTileHeuristic(AyStar *as, AyStarNode *current, Open
/* for train-stations, we are going to aim for the closest station tile */
if (as->user_data[NPF_TYPE] == TRANSPORT_RAIL && fstd->station_index != INVALID_STATION)
- to = CalcClosestStationTile(fstd->station_index, from);
+ to = CalcClosestStationTile(fstd->station_index, from, STATION_RAIL);
if (as->user_data[NPF_TYPE] == TRANSPORT_ROAD) {
/* Since roads only have diagonal pieces, we use manhattan distance here */
@@ -1089,7 +1089,7 @@ void NPFFillWithOrderData(NPFFindStationOrTileData *fstd, const Vehicle *v, bool
if (v->type == VEH_TRAIN && (v->current_order.IsType(OT_GOTO_STATION) || v->current_order.IsType(OT_GOTO_WAYPOINT))) {
fstd->station_index = v->current_order.GetDestination();
/* Let's take the closest tile of the station as our target for trains */
- fstd->dest_coords = CalcClosestStationTile(fstd->station_index, v->tile);
+ fstd->dest_coords = CalcClosestStationTile(fstd->station_index, v->tile, STATION_RAIL);
} else {
fstd->dest_coords = v->dest_tile;
fstd->station_index = INVALID_STATION;