mirror of https://github.com/OpenRCT2/OpenRCT2.git
Fix #14003: NPE in TryReconnectBoatToTrack()
This commit is contained in:
parent
d1b0ef4ea1
commit
f2b4d9dcf6
|
@ -4230,12 +4230,13 @@ void Vehicle::TryReconnectBoatToTrack(const CoordsXY& currentBoatLocation, const
|
|||
TrackLocation.x = trackCoords.x;
|
||||
TrackLocation.y = trackCoords.y;
|
||||
|
||||
auto trackElement = MapGetTrackElementAt(TrackLocation);
|
||||
|
||||
auto curRide = GetRide();
|
||||
if (curRide != nullptr)
|
||||
{
|
||||
SetTrackType(trackElement->GetTrackType());
|
||||
auto trackElement = MapGetTrackElementAt(TrackLocation);
|
||||
if (trackElement != nullptr)
|
||||
SetTrackType(trackElement->GetTrackType());
|
||||
|
||||
SetTrackDirection(curRide->boat_hire_return_direction);
|
||||
BoatLocation.SetNull();
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue