mirror of
https://github.com/OpenRCT2/OpenRCT2
synced 2026-01-29 17:54:50 +01:00
This commit is contained in:
@@ -298,9 +298,9 @@ static ScreenCoordsXY Translate3DTo2D(int32_t rotation, const CoordsXY& pos);
|
||||
|
||||
void TileElementIteratorBegin(TileElementIterator* it)
|
||||
{
|
||||
it->x = 0;
|
||||
it->y = 0;
|
||||
it->element = MapGetFirstElementAt(TileCoordsXY{ 0, 0 });
|
||||
it->x = 1;
|
||||
it->y = 1;
|
||||
it->element = MapGetFirstElementAt(TileCoordsXY{ 1, 1 });
|
||||
}
|
||||
|
||||
int32_t TileElementIteratorNext(TileElementIterator* it)
|
||||
@@ -317,16 +317,17 @@ int32_t TileElementIteratorNext(TileElementIterator* it)
|
||||
return 1;
|
||||
}
|
||||
|
||||
if (it->y < (MAXIMUM_MAP_SIZE_TECHNICAL - 1))
|
||||
auto& gameState = GetGameState();
|
||||
if (it->y < (gameState.MapSize.y - 2))
|
||||
{
|
||||
it->y++;
|
||||
it->element = MapGetFirstElementAt(TileCoordsXY{ it->x, it->y });
|
||||
return 1;
|
||||
}
|
||||
|
||||
if (it->x < (MAXIMUM_MAP_SIZE_TECHNICAL - 1))
|
||||
if (it->x < (gameState.MapSize.x - 2))
|
||||
{
|
||||
it->y = 0;
|
||||
it->y = 1;
|
||||
it->x++;
|
||||
it->element = MapGetFirstElementAt(TileCoordsXY{ it->x, it->y });
|
||||
return 1;
|
||||
|
||||
Reference in New Issue
Block a user