Fix #11696: Graphics set parameters missing from survey data (#11764)

This commit is contained in:
Jonathan G Rennison 2024-01-12 21:53:31 +00:00 committed by GitHub
parent 479490d7e8
commit b3f31a6523
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 6 additions and 0 deletions

View File

@ -248,6 +248,12 @@ void SurveyConfiguration(nlohmann::json &survey)
}
if (BaseGraphics::GetUsedSet() != nullptr) {
survey["graphics_set"] = fmt::format("{}.{}", BaseGraphics::GetUsedSet()->name, BaseGraphics::GetUsedSet()->version);
const GRFConfig *extra_cfg = BaseGraphics::GetUsedSet()->GetExtraConfig();
if (extra_cfg != nullptr && extra_cfg->num_params > 0) {
survey["graphics_set_parameters"] = span<const uint32_t>(extra_cfg->param.data(), extra_cfg->num_params);
} else {
survey["graphics_set_parameters"] = span<const uint32_t>();
}
}
if (BaseMusic::GetUsedSet() != nullptr) {
survey["music_set"] = fmt::format("{}.{}", BaseMusic::GetUsedSet()->name, BaseMusic::GetUsedSet()->version);