mirror of https://github.com/OpenRCT2/OpenRCT2.git
Remove to do statement by explicit null check on collideVehicle
This commit is contained in:
parent
e250ec3b66
commit
b009643ab0
|
@ -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)
|
||||
|
|
Loading…
Reference in New Issue