From 0581b1edd328901141fb77883b4423e39cb7a28f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C5=82=20Janiszewski?= Date: Sun, 24 Mar 2024 21:21:18 +0100 Subject: [PATCH] Fix #18413: Trying to set tooltip using null vehicle (#21662) --- distribution/changelog.txt | 1 + src/openrct2/ride/Vehicle.cpp | 2 ++ 2 files changed, 3 insertions(+) diff --git a/distribution/changelog.txt b/distribution/changelog.txt index 74a0c359bb..4e51bcc83e 100644 --- a/distribution/changelog.txt +++ b/distribution/changelog.txt @@ -6,6 +6,7 @@ - Improved: [#21599] Currency signs now use non-breaking spaces. - Change: [#21529] Classify “Southern Sands”, “Tiny Towers”, “Nevermore Park”, “Pacifica” as expert scenarios. - Fix: [#910] Extra viewport does not preserve the location when rotating. +- Fix: [#18413] Crash when mouse over a hacked train. - Fix: [#20338] Cannot select Scenery Picker or Scatter Tool when the scenery recolouring tool is active. - Fix: [#21419] Cannot place walls underground beneath sloped tiles with clearance checks disabled. - Fix: [#21434] Number of guests overflows in objective text. diff --git a/src/openrct2/ride/Vehicle.cpp b/src/openrct2/ride/Vehicle.cpp index ffe7b8e429..5f0d003950 100644 --- a/src/openrct2/ride/Vehicle.cpp +++ b/src/openrct2/ride/Vehicle.cpp @@ -5055,6 +5055,8 @@ void Vehicle::SetMapToolbar() const if (curRide != nullptr && curRide->type < RIDE_TYPE_COUNT) { const Vehicle* vehicle = GetHead(); + if (vehicle == nullptr) + return; size_t vehicleIndex; for (vehicleIndex = 0; vehicleIndex < std::size(curRide->vehicles); vehicleIndex++)