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.
pull/730/head
Jonathan G Rennison 1 month ago
parent f72d8d0b48
commit 1133ce2432

@ -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});
}
}
}

Loading…
Cancel
Save