(svn r16852) -Codechange: use FOR_ALL_CARGOSPECS for iterating over all valid CargoSpecs

This commit is contained in:
smatz
2009-07-16 20:40:06 +00:00
parent 665fa7f9c1
commit 77d13eae61
11 changed files with 100 additions and 86 deletions

View File

@@ -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)

View File

@@ -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());
}
}