summaryrefslogtreecommitdiff
path: root/depot_gui.c
diff options
context:
space:
mode:
Diffstat (limited to 'depot_gui.c')
-rw-r--r--depot_gui.c18
1 files changed, 18 insertions, 0 deletions
diff --git a/depot_gui.c b/depot_gui.c
index da879bb42..c0ee00ddc 100644
--- a/depot_gui.c
+++ b/depot_gui.c
@@ -1033,3 +1033,21 @@ void ShowDepotWindow(TileIndex tile, byte type)
ResizeDepotButtons(w);
}
}
+
+/** Removes the highlight of a vehicle in a depot window
+ * @param *v Vehicle to remove all highlights from
+ */
+void DeleteDepotHighlightOfVehicle(const Vehicle *v)
+{
+ Window* const *wz;
+
+ FOR_ALL_WINDOWS(wz) {
+ const Window *w = *wz;
+ if (w->window_class != WC_VEHICLE_DEPOT) continue;
+ if (w->window_number != v->tile) continue;
+ if (WP(w, depot_d).sel == v->index) {
+ WP(w, depot_d).sel = INVALID_VEHICLE;
+ ResetObjectToPlace();
+ }
+ }
+}