1
0
mirror of https://github.com/OpenRCT2/OpenRCT2 synced 2026-01-15 11:03:00 +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:
duncanspumpkin
2016-11-03 18:23:42 +00:00
parent e3f76a1140
commit cc0803d466

View File

@@ -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;