From ad1bfe0f4928e6485527e4b776a7104a4152ff08 Mon Sep 17 00:00:00 2001 From: ZxBiohazardZx Date: Fri, 7 May 2021 14:23:37 +0200 Subject: [PATCH] Fix #14582: Vehicle::GetCar function causing server crash (#14583) Co-authored-by: @RoyGherbel --- src/openrct2/peep/Guest.cpp | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/openrct2/peep/Guest.cpp b/src/openrct2/peep/Guest.cpp index 19fddfafaa..4c808e1045 100644 --- a/src/openrct2/peep/Guest.cpp +++ b/src/openrct2/peep/Guest.cpp @@ -3664,6 +3664,10 @@ void Guest::UpdateRideAdvanceThroughEntrance() } vehicle = vehicle->GetCar(CurrentCar); + if (vehicle == nullptr) + { + return; + } ride_entry = vehicle->GetRideEntry(); if (ride_entry == nullptr) @@ -3981,6 +3985,10 @@ void Guest::UpdateRideEnterVehicle() if (vehicle != nullptr) { vehicle = vehicle->GetCar(CurrentCar); + if (vehicle == nullptr) + { + return; + } if (ride->mode != RideMode::ForwardRotation && ride->mode != RideMode::BackwardRotation) {