summaryrefslogtreecommitdiff
path: root/ai_new.c
diff options
context:
space:
mode:
Diffstat (limited to 'ai_new.c')
-rw-r--r--ai_new.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/ai_new.c b/ai_new.c
index cabd0ee9a..c3de5fedb 100644
--- a/ai_new.c
+++ b/ai_new.c
@@ -26,6 +26,7 @@
#include "station.h"
#include "engine.h"
#include "gui.h"
+#include "depot.h"
// This function is called after StartUp. It is the init of an AI
static void AiNew_State_FirstTime(Player *p) {
@@ -1166,7 +1167,7 @@ static void AiNew_State_GiveOrders(Player *p) {
idx = 2;
order.type = OT_GOTO_DEPOT;
order.flags = OF_UNLOAD;
- order.station = GetDepotByTile(p->ainew.depot_tile);
+ order.station = GetDepotByTile(p->ainew.depot_tile)->index;
DoCommandByTile(0, p->ainew.veh_id + (idx << 16), PackOrder(&order), DC_EXEC, CMD_INSERT_ORDER);
}