1
0
mirror of https://github.com/OpenTTD/OpenTTD.git synced 2025-09-03 03:49:12 +00:00

Codechange: Early-continue instead of nested ifs.

This commit is contained in:
2025-02-15 11:32:49 +00:00
parent e74b4aa521
commit abcbabe8c4

View File

@@ -306,11 +306,11 @@ static void PlaceTreeGroups(uint num_groups)
int y = GB(r, 8, 5) - GROVE_RADIUS;
TileIndex cur_tile = TileAddWrap(center_tile, x, y);
if (cur_tile != INVALID_TILE && CanPlantTreesOnTile(cur_tile, true)) {
if(IsPointInStarShapedPolygon(x, y, grove)) {
PlaceTree(cur_tile, r);
}
}
if (cur_tile == INVALID_TILE) continue;
if (!CanPlantTreesOnTile(cur_tile, true)) continue;
if (!IsPointInStarShapedPolygon(x, y, grove)) continue;
PlaceTree(cur_tile, r);
}
} while (--num_groups);