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/newgrf_station.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/newgrf_station.cpp')
-rw-r--r-- | src/newgrf_station.cpp | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/src/newgrf_station.cpp b/src/newgrf_station.cpp index 9b91d83eb..483bf28c3 100644 --- a/src/newgrf_station.cpp +++ b/src/newgrf_station.cpp @@ -610,11 +610,11 @@ static const SpriteGroup *ResolveStation(ResolverObject *object) ctype = CT_PURCHASE; } else { /* Pick the first cargo that we have waiting */ - for (CargoID cargo = 0; cargo < NUM_CARGO; cargo++) { - const CargoSpec *cs = CargoSpec::Get(cargo); - if (cs->IsValid() && object->u.station.statspec->spritegroup[cargo] != NULL && - !object->u.station.st->goods[cargo].cargo.Empty()) { - ctype = cargo; + const CargoSpec *cs; + FOR_ALL_CARGOSPECS(cs) { + if (object->u.station.statspec->spritegroup[cs->Index()] != NULL && + !object->u.station.st->goods[cs->Index()].cargo.Empty()) { + ctype = cs->Index(); break; } } |