Fix #10155: SyncCompanySettings sending old instead of new setting values (#10158)

This commit is contained in:
Jonathan G Rennison 2022-11-12 17:24:31 +00:00 committed by GitHub
parent 59645c6733
commit 7c3c92f8b8
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -1602,8 +1602,8 @@ void SyncCompanySettings()
const void *new_object = &_settings_client.company;
for (auto &desc : _company_settings) {
const SettingDesc *sd = GetSettingDesc(desc);
uint32 old_value = (uint32)sd->AsIntSetting()->Read(new_object);
uint32 new_value = (uint32)sd->AsIntSetting()->Read(old_object);
uint32 old_value = (uint32)sd->AsIntSetting()->Read(old_object);
uint32 new_value = (uint32)sd->AsIntSetting()->Read(new_object);
if (old_value != new_value) Command<CMD_CHANGE_COMPANY_SETTING>::SendNet(STR_NULL, _local_company, sd->GetName(), new_value);
}
}