mirror of https://github.com/OpenTTD/OpenTTD
Codefix: early continue, avoid sideeffects
Co-authored-by: Peter Nelson <peter@fuzzle.org>pull/12712/head
parent
a75532dd47
commit
89182e4b15
|
@ -98,12 +98,9 @@ static bool IsNearbyForest(TileIndex tile)
|
||||||
|
|
||||||
/* Count the trees around the clear tile to determine if it's near a forest */
|
/* Count the trees around the clear tile to determine if it's near a forest */
|
||||||
for (TileIndex t : TileArea(tile).Expand(FOREST_SEARCH_RADIUS)) {
|
for (TileIndex t : TileArea(tile).Expand(FOREST_SEARCH_RADIUS)) {
|
||||||
if (IsTileType(t, MP_TREES)) {
|
if (!IsTileType(t, MP_TREES)) continue;
|
||||||
if (++planted_tile_count >= FOREST_THRESHOLD)
|
++planted_tile_count;
|
||||||
{
|
if (planted_tile_count >= FOREST_THRESHOLD) return true;
|
||||||
return true;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return false;
|
return false;
|
||||||
|
|
Loading…
Reference in New Issue