mirror of
https://github.com/OpenRCT2/OpenRCT2.git
synced 2025-01-22 10:21:57 -05:00
Fix #9491: Access violation in window_ride_init_viewport
This commit is contained in:
parent
9236f5f10b
commit
6458514361
2 changed files with 6 additions and 1 deletions
|
@ -131,6 +131,7 @@ The following people are not part of the development team, but have been contrib
|
|||
* Trevor Harkness (tharkne)
|
||||
* Steve Xu (stevexu-umich)
|
||||
* (aw20368)
|
||||
* Jim Armstrong (41northstudios)
|
||||
|
||||
## Toolchain
|
||||
* (Balletie) - macOS
|
||||
|
|
|
@ -1865,7 +1865,11 @@ static void window_ride_init_viewport(rct_window* w)
|
|||
if (ride_entry && ride_entry->tab_vehicle != 0)
|
||||
{
|
||||
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;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue