From f6285a659c0457b2b468d53885a583e126a07302 Mon Sep 17 00:00:00 2001 From: tron Date: Fri, 24 Mar 2006 08:55:08 +0000 Subject: (svn r4079) Add GetSation{Index,ByTile}() to get the station index resp. the station from a tile --- order_gui.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'order_gui.c') diff --git a/order_gui.c b/order_gui.c index a83c7b70e..c1f4bc79b 100644 --- a/order_gui.c +++ b/order_gui.c @@ -3,6 +3,7 @@ #include "stdafx.h" #include "openttd.h" #include "road_map.h" +#include "station_map.h" #include "table/sprites.h" #include "table/strings.h" #include "functions.h" @@ -190,7 +191,6 @@ static void DrawOrdersWindow(Window *w) static Order GetOrderCmdFromTile(const Vehicle *v, TileIndex tile) { Order order; - int st_index; // check depot first if (_patches.gotodepot) { @@ -221,7 +221,7 @@ static Order GetOrderCmdFromTile(const Vehicle *v, TileIndex tile) if (IsAircraftHangarTile(tile) && IsTileOwner(tile, _local_player)) { order.type = OT_GOTO_DEPOT; order.flags = OF_PART_OF_ORDERS; - order.station = _m[tile].m2; + order.station = GetStationIndex(tile); return order; } break; @@ -257,7 +257,8 @@ static Order GetOrderCmdFromTile(const Vehicle *v, TileIndex tile) } if (IsTileType(tile, MP_STATION)) { - const Station* st = GetStation(st_index = _m[tile].m2); + StationID st_index = GetStationIndex(tile); + const Station* st = GetStation(st_index); if (st->owner == _current_player || st->owner == OWNER_NONE) { byte facil; -- cgit v1.2.3-54-g00ecf