summaryrefslogtreecommitdiff
path: root/src/script
diff options
context:
space:
mode:
authorglx <glx@openttd.org>2019-12-15 22:45:18 +0100
committerNiels Martin Hansen <nielsm@indvikleren.dk>2019-12-21 20:13:03 +0100
commit1f6b3a37f9c39adb22eb61d3153b0c62bfa20551 (patch)
tree15486a7d6bb1445f3d6f1cbf40f98c1552368c08 /src/script
parent1c92ba8ebed55e5455d6f57508db8ce55071d6eb (diff)
downloadopenttd-1f6b3a37f9c39adb22eb61d3153b0c62bfa20551.tar.xz
Codechange: Replace FOR_ALL_ENGINES with range-based for loops
Diffstat (limited to 'src/script')
-rw-r--r--src/script/api/script_enginelist.cpp3
1 files changed, 1 insertions, 2 deletions
diff --git a/src/script/api/script_enginelist.cpp b/src/script/api/script_enginelist.cpp
index 3f4b5d3ff..c6f594cc7 100644
--- a/src/script/api/script_enginelist.cpp
+++ b/src/script/api/script_enginelist.cpp
@@ -15,8 +15,7 @@
ScriptEngineList::ScriptEngineList(ScriptVehicle::VehicleType vehicle_type)
{
- Engine *e;
- FOR_ALL_ENGINES_OF_TYPE(e, (::VehicleType)vehicle_type) {
+ for (const Engine *e : Engine::IterateType((::VehicleType)vehicle_type)) {
if (ScriptObject::GetCompany() == OWNER_DEITY || HasBit(e->company_avail, ScriptObject::GetCompany())) this->AddItem(e->index);
}
}