forked from mirror/OpenTTD
Codechange: Replace network related FOR_ALL with range-based for loops
This commit is contained in:
@@ -1234,8 +1234,7 @@ void NetworkClientsToSpectators(CompanyID cid)
|
||||
/* If our company is changing owner, go to spectators */
|
||||
if (cid == _local_company) SetLocalCompany(COMPANY_SPECTATOR);
|
||||
|
||||
NetworkClientInfo *ci;
|
||||
FOR_ALL_CLIENT_INFOS(ci) {
|
||||
for (NetworkClientInfo *ci : NetworkClientInfo::Iterate()) {
|
||||
if (ci->client_playas != cid) continue;
|
||||
NetworkTextMessage(NETWORK_ACTION_COMPANY_SPECTATOR, CC_DEFAULT, false, ci->client_name);
|
||||
ci->client_playas = COMPANY_SPECTATOR;
|
||||
@@ -1299,8 +1298,7 @@ bool NetworkClientPreferTeamChat(const NetworkClientInfo *cio)
|
||||
/* Only companies actually playing can speak to team. Eg spectators cannot */
|
||||
if (!_settings_client.gui.prefer_teamchat || !Company::IsValidID(cio->client_playas)) return false;
|
||||
|
||||
const NetworkClientInfo *ci;
|
||||
FOR_ALL_CLIENT_INFOS(ci) {
|
||||
for (const NetworkClientInfo *ci : NetworkClientInfo::Iterate()) {
|
||||
if (ci->client_playas == cio->client_playas && ci != cio) return true;
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user