diff options
author | dominik <dominik@openttd.org> | 2004-08-15 13:21:18 +0000 |
---|---|---|
committer | dominik <dominik@openttd.org> | 2004-08-15 13:21:18 +0000 |
commit | 43d691df17d98aa5493e63d9e7e082d975290af8 (patch) | |
tree | 28db4e04a1455a8c875507c7a3e92e1af81af191 /station_cmd.c | |
parent | f5e2d7593149e603cb06673151d5799ffe708b23 (diff) | |
download | openttd-43d691df17d98aa5493e63d9e7e082d975290af8.tar.xz |
(svn r56) Improved order checker + patch setting for it (celestar)
Diffstat (limited to 'station_cmd.c')
-rw-r--r-- | station_cmd.c | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/station_cmd.c b/station_cmd.c index d10e9ef3b..3422e5a9a 100644 --- a/station_cmd.c +++ b/station_cmd.c @@ -61,6 +61,20 @@ static Station *GetStationAround(uint tile, int w, int h, int closest_station) return (closest_station == -1) ? NULL : DEREF_STATION(closest_station); } +TileIndex GetStationTileForVehicle(Vehicle *v, Station *st) +{ + TileIndex required_tile=0; + + switch (v->type) { + case VEH_Train: return st->train_tile; + case VEH_Aircraft: return st->airport_tile; + case VEH_Ship: return st->dock_tile; + case VEH_Road: return (v->cargo_type == CT_PASSENGERS) ? st->bus_tile : st->lorry_tile; + default: + assert(false); + return 0; + } +} static bool CheckStationSpreadOut(Station *st, uint tile, int w, int h) { |