1
0
Fork 0

Compare commits

...

2 Commits

Author SHA1 Message Date
PeterN 6d675c8acf
Fix: #11329: Don't assert vehicle list length is non-zero when only asked to set string parameter. (#11330)
Since #11321, the vehicle list is not yet initialized when SetStringParameters is called, so a test that the vehicle list size is zero is triggered. However, doing this check in the SetStringParameters function is a bit out of its remit, so just remove it.
2023-09-21 13:24:53 +01:00
PeterN cef6a5f79c
Fix #11326: Update autoreplace scrollbar count after clearing engine list. (#11327) 2023-09-21 07:42:49 +01:00
2 changed files with 1 additions and 5 deletions

View File

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

View File

@ -1936,11 +1936,6 @@ public:
case WID_VL_CAPTION_SHARED_ORDERS: {
switch (this->vli.type) {
case VL_SHARED_ORDERS: // Shared Orders
if (this->vehicles.size() == 0) {
/* We can't open this window without vehicles using this order
* and we should close the window when deleting the order. */
NOT_REACHED();
}
SetDParam(0, this->vehicles.size());
break;