Fix #11326: Update autoreplace scrollbar count after clearing engine list. (#11327)

(cherry picked from commit cef6a5f79c)
This commit is contained in:
PeterN 2023-09-21 07:42:49 +01:00 committed by Jonathan G Rennison
parent b70f8020e6
commit c2ef54525a

View File

@ -227,6 +227,7 @@ class ReplaceVehicleWindow : public Window {
/* Always empty the right engines list when nothing is selected in the left engines list */ /* Always empty the right engines list when nothing is selected in the left engines list */
this->engines[1].clear(); this->engines[1].clear();
this->sel_engine[1] = INVALID_ENGINE; this->sel_engine[1] = INVALID_ENGINE;
this->vscroll[1]->SetCount(this->engines[1].size());
} else { } else {
if (this->reset_sel_engine && this->sel_engine[0] != INVALID_ENGINE) { if (this->reset_sel_engine && this->sel_engine[0] != INVALID_ENGINE) {
/* Select the current replacement for sel_engine[0]. */ /* Select the current replacement for sel_engine[0]. */