mirror of https://github.com/OpenRCT2/OpenRCT2.git
Fix #15878: Crash when opening ride window for corrupted vehicle
This commit is contained in:
parent
4ff0022c58
commit
e1a1560fd2
|
@ -4,6 +4,7 @@
|
||||||
- Fix: [#15620] Placing track designs at locations blocked by anything results in wrong error message.
|
- Fix: [#15620] Placing track designs at locations blocked by anything results in wrong error message.
|
||||||
- Fix: [#15843] Tile Inspector can be resized too small.
|
- Fix: [#15843] Tile Inspector can be resized too small.
|
||||||
- Fix: [#15844] Tile Inspector has inconsistent text colours.
|
- Fix: [#15844] Tile Inspector has inconsistent text colours.
|
||||||
|
- Fix: [#15878] Crash when opening a ride window for a corrupted vehicle.
|
||||||
|
|
||||||
0.3.5 (2021-11-06)
|
0.3.5 (2021-11-06)
|
||||||
------------------------------------------------------------------------
|
------------------------------------------------------------------------
|
||||||
|
|
|
@ -1394,7 +1394,13 @@ rct_window* window_ride_open_track(TileElement* tileElement)
|
||||||
*/
|
*/
|
||||||
rct_window* window_ride_open_vehicle(Vehicle* vehicle)
|
rct_window* window_ride_open_vehicle(Vehicle* vehicle)
|
||||||
{
|
{
|
||||||
|
if (vehicle == nullptr)
|
||||||
|
return nullptr;
|
||||||
|
|
||||||
Vehicle* headVehicle = vehicle->TrainHead();
|
Vehicle* headVehicle = vehicle->TrainHead();
|
||||||
|
if (headVehicle == nullptr)
|
||||||
|
return nullptr;
|
||||||
|
|
||||||
uint16_t headVehicleSpriteIndex = headVehicle->sprite_index;
|
uint16_t headVehicleSpriteIndex = headVehicle->sprite_index;
|
||||||
auto ride = headVehicle->GetRide();
|
auto ride = headVehicle->GetRide();
|
||||||
if (ride == nullptr)
|
if (ride == nullptr)
|
||||||
|
|
Loading…
Reference in New Issue