From dc32b0533c134c5f3c42a3427c39ca1f88a2c879 Mon Sep 17 00:00:00 2001 From: Jonathan G Rennison Date: Sat, 3 Jun 2023 20:29:55 +0100 Subject: [PATCH] Viewport: Fix fixed vehicle route overlays not being marked dirty on remove --- src/viewport.cpp | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/viewport.cpp b/src/viewport.cpp index c1e3cd77d1..c5a79f37ce 100644 --- a/src/viewport.cpp +++ b/src/viewport.cpp @@ -4494,8 +4494,12 @@ void AddFixedViewportRoutePath(VehicleID veh) void RemoveFixedViewportRoutePath(VehicleID veh) { - container_unordered_remove_if(_vp_fixed_route_overlays, [&](const FixedVehicleViewportRouteOverlay &it) -> bool { - return it.veh == veh; + container_unordered_remove_if(_vp_fixed_route_overlays, [&](FixedVehicleViewportRouteOverlay &it) -> bool { + if (it.veh == veh) { + it.MarkAllDirty(Vehicle::GetIfValid(it.veh)); + return true; + } + return false; }); }