summaryrefslogtreecommitdiff
path: root/order_gui.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
commitf6285a659c0457b2b468d53885a583e126a07302 (patch)
tree4f245f2fb33365183177a0e7de46103b9c2464d3 /order_gui.c
parent8ce4bdfad969dd1d81ad3ab7d1a09dabf0f7a872 (diff)
downloadopenttd-f6285a659c0457b2b468d53885a583e126a07302.tar.xz
(svn r4079) Add GetSation{Index,ByTile}() to get the station index resp. the station from a tile
Diffstat (limited to 'order_gui.c')
-rw-r--r--order_gui.c7
1 files changed, 4 insertions, 3 deletions
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;