summaryrefslogtreecommitdiff
path: root/src/ai
diff options
context:
space:
mode:
Diffstat (limited to 'src/ai')
-rw-r--r--src/ai/api/ai_cargo.cpp2
-rw-r--r--src/ai/api/ai_cargolist.cpp8
2 files changed, 4 insertions, 6 deletions
diff --git a/src/ai/api/ai_cargo.cpp b/src/ai/api/ai_cargo.cpp
index 4b1593d26..cf9868e2f 100644
--- a/src/ai/api/ai_cargo.cpp
+++ b/src/ai/api/ai_cargo.cpp
@@ -46,7 +46,7 @@
{
if (!IsValidCargo(cargo_type)) return TE_NONE;
- return (AICargo::TownEffect)CargoSpec::Get(cargo_type)->town_effect;
+ return (AICargo::TownEffect)::CargoSpec::Get(cargo_type)->town_effect;
}
/* static */ Money AICargo::GetCargoIncome(CargoID cargo_type, uint32 distance, uint32 days_in_transit)
diff --git a/src/ai/api/ai_cargolist.cpp b/src/ai/api/ai_cargolist.cpp
index ebf664dee..b5b04c3ea 100644
--- a/src/ai/api/ai_cargolist.cpp
+++ b/src/ai/api/ai_cargolist.cpp
@@ -10,11 +10,9 @@
AICargoList::AICargoList()
{
- for (byte i = 0; i < NUM_CARGO; i++) {
- const CargoSpec *c = ::CargoSpec::Get(i);
- if (c->IsValid()) {
- this->AddItem(i);
- }
+ const CargoSpec *cs;
+ FOR_ALL_CARGOSPECS(cs) {
+ this->AddItem(cs->Index());
}
}