diff --git a/distribution/changelog.txt b/distribution/changelog.txt index 0c6676d115..06c41de270 100644 --- a/distribution/changelog.txt +++ b/distribution/changelog.txt @@ -59,6 +59,7 @@ - Fix: [#18696] Construction rights cannot be viewed after all are purchased. - Fix: [#18720] Upwards helix is enabled for the Alpine Coaster, even when cheats are off. - Fix: [#18755] Ferris Wheel and Circus ghosts not coloured correctly. +- Fix: [#18802] Game could crash when determining if a mechanic is heading to fix the ride blocking the path. 0.4.2 (2022-10-05) ------------------------------------------------------------------------ diff --git a/src/openrct2/entity/Staff.cpp b/src/openrct2/entity/Staff.cpp index f42827ba58..ed73b6a8ed 100644 --- a/src/openrct2/entity/Staff.cpp +++ b/src/openrct2/entity/Staff.cpp @@ -874,6 +874,9 @@ bool Staff::IsMechanicHeadingToFixRideBlockingPath() return false; auto ride = get_ride(trackElement->GetRideIndex()); + if (ride == nullptr) + return false; + return ride->id == CurrentRide && ride->breakdown_reason == BREAKDOWN_SAFETY_CUT_OUT; }