From 70dc23701425c6a85383c3df39b742ea378a2ccf Mon Sep 17 00:00:00 2001 From: mix <167040362+mixiate@users.noreply.github.com> Date: Mon, 7 Apr 2025 21:18:54 +0100 Subject: [PATCH] Prevent station ends, flat rides and shops invalidating unnecessarily --- src/openrct2/ride/Station.cpp | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/src/openrct2/ride/Station.cpp b/src/openrct2/ride/Station.cpp index 7faa4de6a1..4bbf31785e 100644 --- a/src/openrct2/ride/Station.cpp +++ b/src/openrct2/ride/Station.cpp @@ -332,10 +332,12 @@ static void RideInvalidateStationStart(Ride& ride, StationIndex stationIndex, bo if (tileElement == nullptr) return; - tileElement->AsTrack()->SetHasGreenLight(greenLight); - - // Invalidate map tile - MapInvalidateTileZoom1({ startPos, tileElement->GetBaseZ(), tileElement->GetClearanceZ() }); + TrackElement* const trackElement = tileElement->AsTrack(); + if (trackElement->HasGreenLight() != greenLight) + { + trackElement->SetHasGreenLight(greenLight); + MapInvalidateTileZoom1({ startPos, tileElement->GetBaseZ(), tileElement->GetClearanceZ() }); + } } TileElement* RideGetStationStartTrackElement(const Ride& ride, StationIndex stationIndex)