mirror of
https://github.com/OpenRCT2/OpenRCT2
synced 2026-01-15 11:03:00 +01:00
Remove to do statement by explicit null check on collideVehicle
This commit is contained in:
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user