Codechange: Move command arguments to the back of the networked command function calls.

This commit is contained in:
Michael Lutz
2021-10-03 17:15:48 +02:00
parent b6933a2ebd
commit 549caca39c
48 changed files with 265 additions and 236 deletions

View File

@@ -1549,7 +1549,7 @@ bool SetSettingValue(const IntSettingDesc *sd, int32 value, bool force_newgame)
const IntSettingDesc *setting = sd->AsIntSetting();
if ((setting->flags & SF_PER_COMPANY) != 0) {
if (Company::IsValidID(_local_company) && _game_mode != GM_MENU) {
return DoCommandP(0, 0, value, CMD_CHANGE_COMPANY_SETTING, nullptr, setting->GetName());
return DoCommandP(CMD_CHANGE_COMPANY_SETTING, 0, 0, value, setting->GetName());
}
setting->ChangeValue(&_settings_client.company, value);
@@ -1575,7 +1575,7 @@ bool SetSettingValue(const IntSettingDesc *sd, int32 value, bool force_newgame)
/* send non-company-based settings over the network */
if (!_networking || (_networking && _network_server)) {
return DoCommandP(0, 0, value, CMD_CHANGE_SETTING, nullptr, setting->GetName());
return DoCommandP(CMD_CHANGE_SETTING, 0, 0, value, setting->GetName());
}
return false;
}
@@ -1603,7 +1603,7 @@ void SyncCompanySettings()
const SettingDesc *sd = GetSettingDesc(desc);
uint32 old_value = (uint32)sd->AsIntSetting()->Read(new_object);
uint32 new_value = (uint32)sd->AsIntSetting()->Read(old_object);
if (old_value != new_value) NetworkSendCommand(0, 0, new_value, CMD_CHANGE_COMPANY_SETTING, nullptr, sd->GetName(), _local_company);
if (old_value != new_value) NetworkSendCommand(CMD_CHANGE_COMPANY_SETTING, nullptr, _local_company, 0, 0, new_value, sd->GetName());
}
}