Fix crash on null ride in Guest::UpdateRideLeaveExit (#21668)

This commit is contained in:
Michał Janiszewski 2024-03-26 12:46:34 +01:00 committed by GitHub
parent 2913a0686a
commit 43507671b5
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 12 additions and 8 deletions

View File

@ -23,6 +23,7 @@
- Fix: [#21543] Crash with creating a TrackIterator with invalid arguments.
- Fix: [#21635] Tile inspector hotkey can set wall slope for non-slopeable objects.
- Fix: [#21641] Crash when creating track iterator from an invalid tile element.
- Fix: [#21668] Crash when on null ride in Guest::UpdateRideLeaveExit.
- Fix: [objects#290] “Haunted Mansion” cars have a non-functional third remap colour.
- Fix: [objects#296] Incorrect wall placement around large Kremlin/drab pieces.
- Fix: [objects#300] Incorrect Colosseum and volcano corner clearances.

View File

@ -5025,17 +5025,20 @@ void Guest::UpdateRideLeaveExit()
return;
}
OnExitRide(*ride);
if (ride != nullptr && (PeepFlags & PEEP_FLAGS_TRACKING))
if (ride != nullptr)
{
auto ft = Formatter();
FormatNameTo(ft);
ride->FormatNameTo(ft);
OnExitRide(*ride);
if (gConfigNotifications.GuestLeftRide)
if (PeepFlags & PEEP_FLAGS_TRACKING)
{
News::AddItemToQueue(News::ItemType::PeepOnRide, STR_PEEP_TRACKING_LEFT_RIDE_X, Id, ft);
auto ft = Formatter();
FormatNameTo(ft);
ride->FormatNameTo(ft);
if (gConfigNotifications.GuestLeftRide)
{
News::AddItemToQueue(News::ItemType::PeepOnRide, STR_PEEP_TRACKING_LEFT_RIDE_X, Id, ft);
}
}
}