1
0
mirror of https://github.com/OpenTTD/OpenTTD synced 2025-12-12 07:52:08 +01:00

Doc: reason for using ::SendNet over ::Post in few cases

This commit is contained in:
Rubidium
2024-05-07 16:45:02 +02:00
committed by rubidium42
parent ed888c617b
commit a313676189
3 changed files with 18 additions and 2 deletions

View File

@@ -1790,6 +1790,11 @@ void SyncCompanySettings()
const SettingDesc *sd = GetSettingDesc(desc);
uint32_t old_value = (uint32_t)sd->AsIntSetting()->Read(old_object);
uint32_t new_value = (uint32_t)sd->AsIntSetting()->Read(new_object);
/*
* This is called from a command, and since it contains local configuration information
* that the rest of the clients do not know about, we need to circumvent the normal ::Post
* local command validation and immediately send the command to the server.
*/
if (old_value != new_value) Command<CMD_CHANGE_COMPANY_SETTING>::SendNet(STR_NULL, _local_company, sd->GetName(), new_value);
}
}