summaryrefslogtreecommitdiff
path: root/src/script
diff options
context:
space:
mode:
authorglx <glx@openttd.org>2019-12-16 20:56:10 +0100
committerNiels Martin Hansen <nielsm@indvikleren.dk>2019-12-21 20:13:03 +0100
commit41232f18c18c9ca444282a9e959b7dfd6c93eff5 (patch)
treedce6e69fc4e0c7d441cf4916700aa3156be88e62 /src/script
parent09fa39c5b59d88a076a244cf1623a53b0ffa1434 (diff)
downloadopenttd-41232f18c18c9ca444282a9e959b7dfd6c93eff5.tar.xz
Codechange: Replace network related FOR_ALL with range-based for loops
Diffstat (limited to 'src/script')
-rw-r--r--src/script/api/script_clientlist.cpp6
1 files changed, 2 insertions, 4 deletions
diff --git a/src/script/api/script_clientlist.cpp b/src/script/api/script_clientlist.cpp
index 38d9bae49..eb57d8e44 100644
--- a/src/script/api/script_clientlist.cpp
+++ b/src/script/api/script_clientlist.cpp
@@ -18,8 +18,7 @@
ScriptClientList::ScriptClientList()
{
if (!_networking) return;
- NetworkClientInfo *ci;
- FOR_ALL_CLIENT_INFOS(ci) {
+ for (const NetworkClientInfo *ci : NetworkClientInfo::Iterate()) {
this->AddItem(ci->client_id);
}
}
@@ -36,8 +35,7 @@ ScriptClientList_Company::ScriptClientList_Company(ScriptCompany::CompanyID comp
c = (CompanyID)company;
}
- NetworkClientInfo *ci;
- FOR_ALL_CLIENT_INFOS(ci) {
+ for (const NetworkClientInfo *ci : NetworkClientInfo::Iterate()) {
if (ci->client_playas == c) this->AddItem(ci->client_id);
}
}