mirror of
https://github.com/OpenRCT2/OpenRCT2
synced 2026-01-15 19:13:07 +01:00
Prevent crash #4694. Crash in ride_get_entrance with no station
Issue is being caused by deleting the station track without removing the station track entry in the ride struct. This will prevent the crash but this should not happen in practice.
This commit is contained in:
@@ -7239,6 +7239,10 @@ void ride_get_entrance_or_exit_position_from_screen_position(int screenX, int sc
|
||||
entranceMinY = mapY;
|
||||
|
||||
mapElement = ride_get_station_start_track_element(ride, gRideEntranceExitPlaceStationIndex);
|
||||
if (mapElement == NULL) {
|
||||
*outX = 0x8000;
|
||||
return;
|
||||
}
|
||||
direction = mapElement->type & MAP_ELEMENT_DIRECTION_MASK;
|
||||
stationDirection = direction;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user