mirror of
https://github.com/OpenTTD/OpenTTD.git
synced 2025-09-01 19:09:09 +00:00
(svn r16852) -Codechange: use FOR_ALL_CARGOSPECS for iterating over all valid CargoSpecs
This commit is contained in:
@@ -132,8 +132,11 @@ void InitializeLandscapeVariables(bool only_constants)
|
||||
{
|
||||
if (only_constants) return;
|
||||
|
||||
for (CargoID i = 0; i < NUM_CARGO; i++) {
|
||||
_cargo_payment_rates[i] = CargoSpec::Get(i)->initial_payment;
|
||||
_cargo_payment_rates_frac[i] = 0;
|
||||
memset(_cargo_payment_rates, 0, sizeof(_cargo_payment_rates));
|
||||
memset(_cargo_payment_rates_frac, 0, sizeof(_cargo_payment_rates_frac));
|
||||
|
||||
const CargoSpec *cs;
|
||||
FOR_ALL_CARGOSPECS(cs) {
|
||||
_cargo_payment_rates[cs->Index()] = cs->initial_payment;
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user