mirror of
https://github.com/OpenRCT2/OpenRCT2.git
synced 2025-01-22 10:21:57 -05:00
* Fix #21748: TileElement out of bounds This fixes crashes observed and allows the park to load. The park is overlarge and breaks some assumptions we have in our code. * Use ternaries for checking conditions
This commit is contained in:
parent
4e8f578075
commit
a088f7615b
3 changed files with 8 additions and 3 deletions
|
@ -12,6 +12,7 @@
|
|||
- Fix: [#18723, #21870] Attempting to demolish a flat ride in pause mode allows you to place multiple copies.
|
||||
- Fix: [#19559] Custom rides with long descriptions extend into lower widgets.
|
||||
- Fix: [#21696] Fullscreen window option not correctly applied on macOS.
|
||||
- Fix: [#21749] Crash when loading park bigger than current limits.
|
||||
- Fix: [#21787] Map generator heightmap should respect increased height limits.
|
||||
- Fix: [#21829] When creating a new scenario, the default name contains formatting codes.
|
||||
- Fix: [#21937] Build errors with the ORIGINAL_RATINGS flag.
|
||||
|
|
|
@ -300,7 +300,7 @@ int32_t TileElementIteratorNext(TileElementIterator* it)
|
|||
if (it->element == nullptr)
|
||||
{
|
||||
it->element = MapGetFirstElementAt(TileCoordsXY{ it->x, it->y });
|
||||
return 1;
|
||||
return it->element == nullptr ? 0 : 1;
|
||||
}
|
||||
|
||||
if (!it->element->IsLastForTile())
|
||||
|
@ -314,7 +314,7 @@ int32_t TileElementIteratorNext(TileElementIterator* it)
|
|||
{
|
||||
it->y++;
|
||||
it->element = MapGetFirstElementAt(TileCoordsXY{ it->x, it->y });
|
||||
return 1;
|
||||
return it->element == nullptr ? 0 : 1;
|
||||
}
|
||||
|
||||
if (it->x < (gameState.MapSize.x - 2))
|
||||
|
@ -322,7 +322,7 @@ int32_t TileElementIteratorNext(TileElementIterator* it)
|
|||
it->y = 1;
|
||||
it->x++;
|
||||
it->element = MapGetFirstElementAt(TileCoordsXY{ it->x, it->y });
|
||||
return 1;
|
||||
return it->element == nullptr ? 0 : 1;
|
||||
}
|
||||
|
||||
return 0;
|
||||
|
|
|
@ -619,6 +619,10 @@ void MapAnimationAutoCreate()
|
|||
|
||||
void MapAnimationAutoCreateAtTileElement(TileCoordsXY coords, TileElement* el)
|
||||
{
|
||||
if (el == nullptr)
|
||||
{
|
||||
return;
|
||||
}
|
||||
auto loc = CoordsXYZ{ coords.ToCoordsXY(), el->GetBaseZ() };
|
||||
switch (el->GetType())
|
||||
{
|
||||
|
|
Loading…
Reference in a new issue