summaryrefslogtreecommitdiff
path: root/roadveh_cmd.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 /roadveh_cmd.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 'roadveh_cmd.c')
-rw-r--r--roadveh_cmd.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/roadveh_cmd.c b/roadveh_cmd.c
index 070695f6b..e3f1c6fb4 100644
--- a/roadveh_cmd.c
+++ b/roadveh_cmd.c
@@ -5,6 +5,7 @@
#include "debug.h"
#include "functions.h"
#include "road_map.h"
+#include "station_map.h"
#include "table/strings.h"
#include "map.h"
#include "tile.h"
@@ -1415,7 +1416,7 @@ again:
if (v->u.road.state >= 0x20 &&
_road_veh_data_1[v->u.road.state - 0x20 + (_opt.road_side<<4)] == v->u.road.frame) {
RoadStop *rs = GetRoadStopByTile(v->tile, GetRoadStopType(v->tile));
- Station* st = GetStation(_m[v->tile].m2);
+ Station* st = GetStationByTile(v->tile);
if (v->current_order.type != OT_LEAVESTATION &&
v->current_order.type != OT_GOTO_DEPOT) {
@@ -1423,7 +1424,7 @@ again:
CLRBIT(rs->status, 7);
- v->last_station_visited = _m[v->tile].m2;
+ v->last_station_visited = GetStationIndex(v->tile);
RoadVehArrivesAt(v, st);