From f9e90ed84cbd2dc1017cbf689648b342ff34174f Mon Sep 17 00:00:00 2001 From: Michael Steenbeek Date: Wed, 23 Dec 2020 22:37:43 +0100 Subject: [PATCH] Fix #13641: Game crashes after a while (#13642) --- src/openrct2/peep/Guest.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/openrct2/peep/Guest.cpp b/src/openrct2/peep/Guest.cpp index 8ed9aa1f8f..c4e0b130b5 100644 --- a/src/openrct2/peep/Guest.cpp +++ b/src/openrct2/peep/Guest.cpp @@ -6208,7 +6208,8 @@ static bool peep_find_ride_to_look_at(Peep* peep, uint8_t edge, uint8_t* rideToV if (tileElement->GetType() == TILE_ELEMENT_TYPE_LARGE_SCENERY) { - if (!(tileElement->AsLargeScenery()->GetEntry()->large_scenery.flags & LARGE_SCENERY_FLAG_PHOTOGENIC)) + const auto* sceneryEntry = tileElement->AsLargeScenery()->GetEntry(); + if (sceneryEntry == nullptr || !(sceneryEntry->large_scenery.flags & LARGE_SCENERY_FLAG_PHOTOGENIC)) { continue; }