Fix: Picker window 'used' filter for rail waypoints

The first two field of struct PickerItem were not populated.
These are required for set operations.

StationUsesDefaultType always returned false for rail waypoints.
This commit is contained in:
Jonathan G Rennison 2024-08-22 15:05:50 +01:00
parent f72d8d0b48
commit 1133ce2432

View File

@ -1151,7 +1151,7 @@ static void HandleStationPlacement(TileIndex start, TileIndex end)
static bool StationUsesDefaultType(const BaseStation *bst)
{
for (TileIndex t : bst->train_station) {
if (bst->TileBelongsToRailStation(t) && IsRailStation(t) && GetCustomStationSpecIndex(t) == 0) return true;
if (bst->TileBelongsToRailStation(t) && HasStationRail(t) && GetCustomStationSpecIndex(t) == 0) return true;
}
return false;
}
@ -2263,7 +2263,7 @@ public:
}
for (const auto &sm : wp->speclist) {
if (sm.spec == nullptr) continue;
items.insert({0, 0, sm.spec->class_index, sm.spec->index});
items.insert({sm.grfid, sm.localidx, sm.spec->class_index, sm.spec->index});
}
}
}