summaryrefslogtreecommitdiff
path: root/src/newgrf_station.cpp
diff options
context:
space:
mode:
authorglx22 <glx@openttd.org>2021-04-29 17:51:05 +0200
committerLoïc Guilloux <glx22@users.noreply.github.com>2021-04-29 21:08:24 +0200
commit9a8756d7ed6fdde20bad9be8c8b8bc8fda0170f9 (patch)
tree54941350dff9cc05ee0e9b32e116df385f977a46 /src/newgrf_station.cpp
parent14e92bd8e241998ced263ee542965a71bbdd77a5 (diff)
downloadopenttd-9a8756d7ed6fdde20bad9be8c8b8bc8fda0170f9.tar.xz
Codechange: Replace FOR_ALL_CARGOSPECS with range-based for loops
Diffstat (limited to 'src/newgrf_station.cpp')
-rw-r--r--src/newgrf_station.cpp3
1 files changed, 1 insertions, 2 deletions
diff --git a/src/newgrf_station.cpp b/src/newgrf_station.cpp
index a127d54c9..fa3f831aa 100644
--- a/src/newgrf_station.cpp
+++ b/src/newgrf_station.cpp
@@ -572,8 +572,7 @@ StationResolverObject::StationResolverObject(const StationSpec *statspec, BaseSt
} else if (Station::IsExpected(this->station_scope.st)) {
const Station *st = Station::From(this->station_scope.st);
/* Pick the first cargo that we have waiting */
- const CargoSpec *cs;
- FOR_ALL_CARGOSPECS(cs) {
+ for (const CargoSpec *cs : CargoSpec::Iterate()) {
if (this->station_scope.statspec->grf_prop.spritegroup[cs->Index()] != nullptr &&
st->goods[cs->Index()].cargo.TotalCount() > 0) {
ctype = cs->Index();