summaryrefslogtreecommitdiff
path: root/src/ai/api/ai_cargolist.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/ai/api/ai_cargolist.cpp')
-rw-r--r--src/ai/api/ai_cargolist.cpp12
1 files changed, 12 insertions, 0 deletions
diff --git a/src/ai/api/ai_cargolist.cpp b/src/ai/api/ai_cargolist.cpp
index 1ee1c462d..4b226f65d 100644
--- a/src/ai/api/ai_cargolist.cpp
+++ b/src/ai/api/ai_cargolist.cpp
@@ -12,8 +12,10 @@
#include "../../stdafx.h"
#include "ai_cargolist.hpp"
#include "ai_industry.hpp"
+#include "ai_station.hpp"
#include "../../cargotype.h"
#include "../../industry.h"
+#include "../../station_base.h"
AICargoList::AICargoList()
{
@@ -48,3 +50,13 @@ AICargoList_IndustryProducing::AICargoList_IndustryProducing(IndustryID industry
}
}
}
+
+AICargoList_StationAccepting::AICargoList_StationAccepting(StationID station_id)
+{
+ if (!AIStation::IsValidStation(station_id)) return;
+
+ Station *st = ::Station::Get(station_id);
+ for (CargoID i = 0; i < NUM_CARGO; i++) {
+ if (HasBit(st->goods[i].acceptance_pickup, GoodsEntry::GES_ACCEPTANCE)) this->AddItem(i);
+ }
+}