@@ -7,12 +7,13 @@
#include "functions.h"
#include "npf.h"
#include "aystar.h"
#include "macros.h"
#include "pathfind.h"
#include "station.h"
#include "station_map.h"
#include "tile.h"
#include "depot.h"
#include "tunnel_map.h"
static AyStar _npf_aystar;
@@ -420,13 +421,13 @@ static int32 NPFFindStationOrTile(AyStar
TileIndex tile = node->tile;
/* If GetNeighbours said we could get here, we assume the station type
* 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 {
return AYSTAR_DONE;
}