Fix 7cfcf65: Check if last-remembered build vehicle cargo filter is valid. (#11486)

This can be invalid when switching between games with different cargoes loaded.
This commit is contained in:
Peter Nelson 2023-11-23 22:46:22 +00:00 committed by GitHub
parent 096da3e59f
commit 47eabe0cd9
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 1 additions and 0 deletions

View File

@ -1285,6 +1285,7 @@ struct BuildVehicleWindow : Window {
{
/* Set the last cargo filter criteria. */
this->cargo_filter_criteria = _engine_sort_last_cargo_criteria[this->vehicle_type];
if (this->cargo_filter_criteria < NUM_CARGO && !HasBit(_standard_cargo_mask, this->cargo_filter_criteria)) this->cargo_filter_criteria = CF_ANY;
this->eng_list.SetFilterFuncs(_filter_funcs);
this->eng_list.SetFilterState(this->cargo_filter_criteria != CF_ANY);