Codechange: Store GRFConfig parameters in a vector. (#13137)

All GRFConfigs have space allocated for parameters, but only configured GRFConfigs need them.

Using a vector instead means that space is only used when parameters are used.
This commit is contained in:
Peter Nelson
2024-12-01 15:15:21 +00:00
committed by GitHub
parent e28617fda6
commit 3a310f1802
11 changed files with 76 additions and 57 deletions
+1 -1
View File
@@ -1220,7 +1220,7 @@ static void GraphicsSetSaveConfig(IniFile &ini)
group.GetOrCreateItem("shortname").SetValue(fmt::format("{:08X}", BSWAP32(used_set->shortname)));
const GRFConfig *extra_cfg = used_set->GetExtraConfig();
if (extra_cfg != nullptr && extra_cfg->num_params > 0) {
if (extra_cfg != nullptr && !extra_cfg->param.empty()) {
group.GetOrCreateItem("extra_version").SetValue(fmt::format("{}", extra_cfg->version));
group.GetOrCreateItem("extra_params").SetValue(GRFBuildParamList(extra_cfg));
}