1
0
mirror of https://github.com/OpenRCT2/OpenRCT2 synced 2026-01-29 17:54:50 +01:00

Fix #20164: Grass and Rock terrain objects cannot be de-selected (#21399)

This commit is contained in:
Katherine Norton
2024-03-01 18:33:45 -06:00
committed by GitHub
parent bb743f0c88
commit 534ba4f339
3 changed files with 10 additions and 8 deletions

View File

@@ -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;