From 1133ce24325e7619d237d953ea2d7770bcfc3876 Mon Sep 17 00:00:00 2001 From: Jonathan G Rennison Date: Thu, 22 Aug 2024 15:05:50 +0100 Subject: [PATCH] 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. --- src/rail_gui.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/rail_gui.cpp b/src/rail_gui.cpp index f30c51c6f5..477f74b87d 100644 --- a/src/rail_gui.cpp +++ b/src/rail_gui.cpp @@ -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}); } } }