summaryrefslogtreecommitdiff
path: root/ai/trolly/trolly.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
commit9be713f1ae0cff0bc06bbef395fda8bf829e38c2 (patch)
tree4f245f2fb33365183177a0e7de46103b9c2464d3 /ai/trolly/trolly.c
parent4b0e8947d5053d0987e9d9024156786acd3aec67 (diff)
downloadopenttd-9be713f1ae0cff0bc06bbef395fda8bf829e38c2.tar.xz
(svn r4079) Add GetSation{Index,ByTile}() to get the station index resp. the station from a tile
Diffstat (limited to 'ai/trolly/trolly.c')
-rw-r--r--ai/trolly/trolly.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/ai/trolly/trolly.c b/ai/trolly/trolly.c
index 57cac9698..eac7793ae 100644
--- a/ai/trolly/trolly.c
+++ b/ai/trolly/trolly.c
@@ -22,6 +22,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"
@@ -1202,7 +1203,7 @@ static void AiNew_State_GiveOrders(Player *p)
idx = 0;
order.type = OT_GOTO_STATION;
order.flags = 0;
- order.station = _m[p->ainew.to_tile].m2;
+ order.station = GetStationIndex(p->ainew.to_tile);
if (p->ainew.tbt == AI_TRUCK && p->ainew.to_deliver)
order.flags |= OF_FULL_LOAD;
AI_DoCommand(0, p->ainew.veh_id + (idx << 16), PackOrder(&order), DC_EXEC, CMD_INSERT_ORDER);
@@ -1210,7 +1211,7 @@ static void AiNew_State_GiveOrders(Player *p)
idx = 0;
order.type = OT_GOTO_STATION;
order.flags = 0;
- order.station = _m[p->ainew.from_tile].m2;
+ order.station = GetStationIndex(p->ainew.from_tile);
if (p->ainew.tbt == AI_TRUCK && p->ainew.from_deliver)
order.flags |= OF_FULL_LOAD;
AI_DoCommand(0, p->ainew.veh_id + (idx << 16), PackOrder(&order), DC_EXEC, CMD_INSERT_ORDER);