From b867939f371de8a8a2be26187c9f471eab73611e Mon Sep 17 00:00:00 2001 From: Peter Nelson Date: Sat, 30 Aug 2025 19:47:37 +0100 Subject: [PATCH] Fix #14553: Parameter configuration of pre-action 14 NewGRFs did not work. (#14554) --- src/newgrf_gui.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/newgrf_gui.cpp b/src/newgrf_gui.cpp index da30cac7ee..f33c298519 100644 --- a/src/newgrf_gui.cpp +++ b/src/newgrf_gui.cpp @@ -156,7 +156,7 @@ struct NewGRFParametersWindow : public Window { grf_config(c), editable(editable) { - this->action14present = (this->grf_config.num_valid_params != this->grf_config.param.size() || !this->grf_config.param_info.empty()); + this->action14present = (this->grf_config.num_valid_params != GRFConfig::MAX_NUM_PARAMS || !this->grf_config.param_info.empty()); this->CreateNestedTree(); this->GetWidget(WID_NP_CAPTION)->SetStringTip(is_baseset ? STR_BASEGRF_PARAMETERS_CAPTION : STR_NEWGRF_PARAMETERS_CAPTION, STR_TOOLTIP_WINDOW_TITLE_DRAG_THIS); @@ -481,7 +481,7 @@ struct NewGRFParametersWindow : public Window { this->SetWidgetDisabledState(WID_NP_NUMPAR_INC, !this->editable || std::size(this->grf_config.param) >= this->grf_config.num_valid_params); } - this->vscroll->SetCount(this->action14present ? this->grf_config.num_valid_params : GRFConfig::MAX_NUM_PARAMS); + this->vscroll->SetCount(this->action14present ? this->grf_config.num_valid_params : this->grf_config.param.size()); if (this->clicked_row != INT32_MAX && this->clicked_row >= this->vscroll->GetCount()) { this->clicked_row = INT32_MAX; this->CloseChildWindows(WC_QUERY_STRING);