1
0
mirror of https://github.com/OpenRCT2/OpenRCT2 synced 2025-12-24 08:12:53 +01:00

Fix crash in vehicle_next_tower_element_is_top()

This commit is contained in:
Gymnasiast
2018-09-26 21:20:37 +02:00
parent 539d274297
commit 4a94f02910

View File

@@ -3126,6 +3126,11 @@ static bool vehicle_next_tower_element_is_top(rct_vehicle* vehicle)
if (tileElement->clearance_height == (tileElement + 1)->base_height)
{
if ((tileElement + 1)->GetType() != TILE_ELEMENT_TYPE_TRACK)
{
return true;
}
if ((tileElement + 1)->AsTrack()->GetTrackType() == TRACK_ELEM_TOWER_SECTION)
{
return false;
@@ -3142,6 +3147,11 @@ static bool vehicle_next_tower_element_is_top(rct_vehicle* vehicle)
return true;
}
if ((tileElement + 2)->GetType() != TILE_ELEMENT_TYPE_TRACK)
{
return true;
}
return (tileElement + 2)->AsTrack()->GetTrackType() != TRACK_ELEM_TOWER_SECTION;
}