1
0
mirror of https://github.com/OpenTTD/OpenTTD.git synced 2025-08-29 01:19:11 +00:00

Codechange: just pass the SettingDesc to SetSettingValue and remove distinction between (non)company

This commit is contained in:
rubidium42
2021-05-18 20:57:44 +02:00
committed by rubidium42
parent db54e20825
commit 8ffb4122df
6 changed files with 54 additions and 83 deletions

View File

@@ -2199,9 +2199,7 @@ public:
case WID_CL_SERVER_NAME_EDIT: {
if (!_network_server) break;
uint index;
GetSettingFromName("network.server_name", &index);
SetSettingValue(index, StrEmpty(str) ? "Unnamed Server" : str);
SetSettingValue(GetSettingFromName("network.server_name"), StrEmpty(str) ? "Unnamed Server" : str);
this->InvalidateData();
break;
}
@@ -2210,9 +2208,7 @@ public:
std::string client_name(str);
if (!NetworkValidateClientName(client_name)) break;
uint index;
GetSettingFromName("network.client_name", &index);
SetSettingValue(index, client_name.c_str());
SetSettingValue(GetSettingFromName("network.client_name"), client_name.c_str());
this->InvalidateData();
break;
}