mirror of
https://github.com/OpenRCT2/OpenRCT2
synced 2025-12-19 22:02:57 +01:00
Fix #9491: Access violation in window_ride_init_viewport
This commit is contained in:
committed by
Michael Steenbeek
parent
9236f5f10b
commit
6458514361
@@ -131,6 +131,7 @@ The following people are not part of the development team, but have been contrib
|
|||||||
* Trevor Harkness (tharkne)
|
* Trevor Harkness (tharkne)
|
||||||
* Steve Xu (stevexu-umich)
|
* Steve Xu (stevexu-umich)
|
||||||
* (aw20368)
|
* (aw20368)
|
||||||
|
* Jim Armstrong (41northstudios)
|
||||||
|
|
||||||
## Toolchain
|
## Toolchain
|
||||||
* (Balletie) - macOS
|
* (Balletie) - macOS
|
||||||
|
|||||||
@@ -1865,7 +1865,11 @@ static void window_ride_init_viewport(rct_window* w)
|
|||||||
if (ride_entry && ride_entry->tab_vehicle != 0)
|
if (ride_entry && ride_entry->tab_vehicle != 0)
|
||||||
{
|
{
|
||||||
rct_vehicle* vehicle = GET_VEHICLE(focus.sprite.sprite_id);
|
rct_vehicle* vehicle = GET_VEHICLE(focus.sprite.sprite_id);
|
||||||
if (vehicle->next_vehicle_on_train != SPRITE_INDEX_NULL)
|
if (vehicle == nullptr)
|
||||||
|
{
|
||||||
|
focus.sprite.sprite_id = SPRITE_INDEX_NULL;
|
||||||
|
}
|
||||||
|
else if (vehicle->next_vehicle_on_train != SPRITE_INDEX_NULL)
|
||||||
{
|
{
|
||||||
focus.sprite.sprite_id = vehicle->next_vehicle_on_train;
|
focus.sprite.sprite_id = vehicle->next_vehicle_on_train;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user