summaryrefslogtreecommitdiff
path: root/npf.c
diff options
context:
space:
mode:
authortron <tron@openttd.org>2006-03-24 08:55:08 +0000
committertron <tron@openttd.org>2006-03-24 08:55:08 +0000
commit9be713f1ae0cff0bc06bbef395fda8bf829e38c2 (patch)
tree4f245f2fb33365183177a0e7de46103b9c2464d3 /npf.c
parent4b0e8947d5053d0987e9d9024156786acd3aec67 (diff)
downloadopenttd-9be713f1ae0cff0bc06bbef395fda8bf829e38c2.tar.xz
(svn r4079) Add GetSation{Index,ByTile}() to get the station index resp. the station from a tile
Diffstat (limited to 'npf.c')
-rw-r--r--npf.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/npf.c b/npf.c
index 70e6ed947..68d793186 100644
--- a/npf.c
+++ b/npf.c
@@ -10,6 +10,7 @@
#include "macros.h"
#include "pathfind.h"
#include "station.h"
+#include "station_map.h"
#include "tile.h"
#include "depot.h"
#include "tunnel_map.h"
@@ -423,7 +424,7 @@ static int32 NPFFindStationOrTile(AyStar* as, OpenListNode *current)
* is correct */
if (
(fstd->station_index == INVALID_STATION && tile == fstd->dest_coords) || /* We've found the tile, or */
- (IsTileType(tile, MP_STATION) && _m[tile].m2 == fstd->station_index) /* the station */
+ (IsTileType(tile, MP_STATION) && GetStationIndex(tile) == fstd->station_index) /* the station */
) {
return AYSTAR_FOUND_END_NODE;
} else {