1
0
mirror of https://github.com/OpenTTD/OpenTTD.git synced 2025-08-19 04:29:09 +00:00

Codechange: exit early if past forest threshold

This commit is contained in:
Susan
2024-06-04 13:11:30 +01:00
parent 6d40780434
commit a75532dd47

View File

@@ -99,11 +99,14 @@ static bool IsNearbyForest(TileIndex tile)
/* Count the trees around the clear tile to determine if it's near a forest */
for (TileIndex t : TileArea(tile).Expand(FOREST_SEARCH_RADIUS)) {
if (IsTileType(t, MP_TREES)) {
planted_tile_count++;
if (++planted_tile_count >= FOREST_THRESHOLD)
{
return true;
}
}
}
return (planted_tile_count >= FOREST_THRESHOLD);
return false;
}
/**