(svn r16852) -Codechange: use FOR_ALL_CARGOSPECS for iterating over all valid CargoSpecs
This commit is contained in:
@@ -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)
|
||||
|
@@ -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());
|
||||
}
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user