diff options
Diffstat (limited to 'src/vehiclelist.cpp')
-rw-r--r-- | src/vehiclelist.cpp | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/src/vehiclelist.cpp b/src/vehiclelist.cpp index 2341a31ad..14798b655 100644 --- a/src/vehiclelist.cpp +++ b/src/vehiclelist.cpp @@ -67,6 +67,7 @@ void BuildDepotVehicleList(VehicleType type, TileIndex tile, VehicleList *engine * <li>VLW_STANDARD: not used<li> * <li>VLW_DEPOT_LIST: TileIndex of the depot/hangar to make the list for</li> * <li>VLW_GROUP_LIST: index of group to generate a list for</li> + * <li>VLM_WAYPOINT_LIST: index of waypoint to generate a list for</li> * </ul> * @param window_type The type of window the list is for, using the VLW_ flags in vehicle_gui.h */ @@ -122,6 +123,21 @@ void GenerateVehicleSortList(VehicleList *list, VehicleType type, PlayerID owner } break; + case VLM_WAYPOINT_LIST: + FOR_ALL_VEHICLES(v) { + if (v->type == type && v->IsPrimaryVehicle()) { + const Order *order; + + FOR_VEHICLE_ORDERS(v, order) { + if (order->IsType(OT_GOTO_WAYPOINT) && order->GetDestination() == index) { + *list->Append() = v; + break; + } + } + } + } + break; + case VLW_GROUP_LIST: FOR_ALL_VEHICLES(v) { if (v->type == type && v->IsPrimaryVehicle() && |