mirror of
https://github.com/OpenTTD/OpenTTD.git
synced 2025-03-13 02:52:37 +00:00
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:
parent
48dc4219ea
commit
a0c6259e33
@ -358,9 +358,6 @@ public:
|
|||||||
this->group_rename = INVALID_GROUP;
|
this->group_rename = INVALID_GROUP;
|
||||||
this->group_over = INVALID_GROUP;
|
this->group_over = INVALID_GROUP;
|
||||||
|
|
||||||
this->BuildVehicleList();
|
|
||||||
this->SortVehicleList();
|
|
||||||
|
|
||||||
this->groups.ForceRebuild();
|
this->groups.ForceRebuild();
|
||||||
this->groups.NeedResort();
|
this->groups.NeedResort();
|
||||||
this->BuildGroupList(vli.company);
|
this->BuildGroupList(vli.company);
|
||||||
@ -377,6 +374,9 @@ public:
|
|||||||
|
|
||||||
this->FinishInitNested(window_number);
|
this->FinishInitNested(window_number);
|
||||||
this->owner = vli.company;
|
this->owner = vli.company;
|
||||||
|
|
||||||
|
this->BuildVehicleList();
|
||||||
|
this->SortVehicleList();
|
||||||
}
|
}
|
||||||
|
|
||||||
~VehicleGroupWindow()
|
~VehicleGroupWindow()
|
||||||
|
@ -1624,10 +1624,11 @@ public:
|
|||||||
this->industries.SetListing(this->last_sorting);
|
this->industries.SetListing(this->last_sorting);
|
||||||
this->industries.SetSortFuncs(IndustryDirectoryWindow::sorter_funcs);
|
this->industries.SetSortFuncs(IndustryDirectoryWindow::sorter_funcs);
|
||||||
this->industries.ForceRebuild();
|
this->industries.ForceRebuild();
|
||||||
this->BuildSortIndustriesList();
|
|
||||||
|
|
||||||
this->FinishInitNested(0);
|
this->FinishInitNested(0);
|
||||||
|
|
||||||
|
this->BuildSortIndustriesList();
|
||||||
|
|
||||||
this->querystrings[WID_ID_FILTER] = &this->industry_editbox;
|
this->querystrings[WID_ID_FILTER] = &this->industry_editbox;
|
||||||
this->industry_editbox.cancel_button = QueryString::ACTION_CLEAR;
|
this->industry_editbox.cancel_button = QueryString::ACTION_CLEAR;
|
||||||
}
|
}
|
||||||
|
@ -1842,9 +1842,6 @@ public:
|
|||||||
|
|
||||||
this->vscroll = this->GetScrollbar(WID_VL_SCROLLBAR);
|
this->vscroll = this->GetScrollbar(WID_VL_SCROLLBAR);
|
||||||
|
|
||||||
this->BuildVehicleList();
|
|
||||||
this->SortVehicleList();
|
|
||||||
|
|
||||||
/* Set up the window widgets */
|
/* Set up the window widgets */
|
||||||
this->GetWidget<NWidgetCore>(WID_VL_LIST)->tool_tip = STR_VEHICLE_LIST_TRAIN_LIST_TOOLTIP + this->vli.vtype;
|
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);
|
this->FinishInitNested(window_number);
|
||||||
if (this->vli.company != OWNER_NONE) this->owner = this->vli.company;
|
if (this->vli.company != OWNER_NONE) this->owner = this->vli.company;
|
||||||
|
|
||||||
|
this->BuildVehicleList();
|
||||||
|
this->SortVehicleList();
|
||||||
}
|
}
|
||||||
|
|
||||||
~VehicleListWindow()
|
~VehicleListWindow()
|
||||||
|
Loading…
Reference in New Issue
Block a user