Codechange: Don't access cargo filter before it is initialized. (#11321)
The cargo filter list is initialized during window OnInit, but the first build of the filtered list occurred before this.
This commit is contained in:
@@ -1842,9 +1842,6 @@ public:
|
||||
|
||||
this->vscroll = this->GetScrollbar(WID_VL_SCROLLBAR);
|
||||
|
||||
this->BuildVehicleList();
|
||||
this->SortVehicleList();
|
||||
|
||||
/* Set up the window widgets */
|
||||
this->GetWidget<NWidgetCore>(WID_VL_LIST)->tool_tip = STR_VEHICLE_LIST_TRAIN_LIST_TOOLTIP + this->vli.vtype;
|
||||
|
||||
@@ -1863,6 +1860,9 @@ public:
|
||||
|
||||
this->FinishInitNested(window_number);
|
||||
if (this->vli.company != OWNER_NONE) this->owner = this->vli.company;
|
||||
|
||||
this->BuildVehicleList();
|
||||
this->SortVehicleList();
|
||||
}
|
||||
|
||||
~VehicleListWindow()
|
||||
|
Reference in New Issue
Block a user