(svn r4079) Add GetSation{Index,ByTile}() to get the station index resp. the station from a tile

This commit is contained in:
tron
2006-03-24 08:55:08 +00:00
parent 8ce4bdfad9
commit f6285a659c
11 changed files with 74 additions and 46 deletions

3
npf.c
View File

@@ -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 {