diff --git a/src/openrct2/ride/Vehicle.cpp b/src/openrct2/ride/Vehicle.cpp index 167ec3cada..1fed0299db 100644 --- a/src/openrct2/ride/Vehicle.cpp +++ b/src/openrct2/ride/Vehicle.cpp @@ -6638,14 +6638,13 @@ bool Vehicle::UpdateMotionCollisionDetection(const CoordsXYZ& loc, EntityId* oth } } - if (!mayCollide) + if (!mayCollide || collideVehicle == nullptr) { CollisionDetectionTimer = 0; return false; } - if (collideVehicle->status == Vehicle::Status::TravellingBoat - && sub_state == BoatHireSubState::EnteringReturnPosition) + if (collideVehicle->status == Vehicle::Status::TravellingBoat && sub_state == BoatHireSubState::EnteringReturnPosition) { return false; } @@ -6659,8 +6658,6 @@ bool Vehicle::UpdateMotionCollisionDetection(const CoordsXYZ& loc, EntityId* oth return true; } - // TODO Is it possible for collideVehicle to be NULL? - if (status == Vehicle::Status::MovingToEndOfStation) { if (Orientation == 0)