Viewport: Fix fixed vehicle route overlays not being marked dirty on remove

This commit is contained in:
Jonathan G Rennison
2023-06-03 20:29:55 +01:00
parent 0a8a9abe28
commit dc32b0533c

View File

@@ -4494,8 +4494,12 @@ void AddFixedViewportRoutePath(VehicleID veh)
void RemoveFixedViewportRoutePath(VehicleID veh) void RemoveFixedViewportRoutePath(VehicleID veh)
{ {
container_unordered_remove_if(_vp_fixed_route_overlays, [&](const FixedVehicleViewportRouteOverlay &it) -> bool { container_unordered_remove_if(_vp_fixed_route_overlays, [&](FixedVehicleViewportRouteOverlay &it) -> bool {
return it.veh == veh; if (it.veh == veh) {
it.MarkAllDirty(Vehicle::GetIfValid(it.veh));
return true;
}
return false;
}); });
} }