diff options
author | smatz <smatz@openttd.org> | 2009-07-16 20:40:06 +0000 |
---|---|---|
committer | smatz <smatz@openttd.org> | 2009-07-16 20:40:06 +0000 |
commit | 77d13eae6194387ca6ce2b0eb835b7f97f67d085 (patch) | |
tree | a15b28b9384b9590cf11866a877097709db4d89d /src/economy.cpp | |
parent | 665fa7f9c170774f6a640ecf381f714b50b6b174 (diff) | |
download | openttd-77d13eae6194387ca6ce2b0eb835b7f97f67d085.tar.xz |
(svn r16852) -Codechange: use FOR_ALL_CARGOSPECS for iterating over all valid CargoSpecs
Diffstat (limited to 'src/economy.cpp')
-rw-r--r-- | src/economy.cpp | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/src/economy.cpp b/src/economy.cpp index bcd678f31..22425bd22 100644 --- a/src/economy.cpp +++ b/src/economy.cpp @@ -832,10 +832,9 @@ void ResetEconomy() /* Test if resetting the economy is needed. */ bool needed = false; - for (CargoID c = 0; c < NUM_CARGO; c++) { - const CargoSpec *cs = CargoSpec::Get(c); - if (!cs->IsValid()) continue; - if (_cargo_payment_rates[c] == 0) { + const CargoSpec *cs; + FOR_ALL_CARGOSPECS(cs) { + if (_cargo_payment_rates[cs->Index()] == 0) { needed = true; break; } |