mirror of https://github.com/OpenTTD/OpenTTD
Codechange: Early-continue instead of nested ifs.
parent
e74b4aa521
commit
abcbabe8c4
|
@ -306,11 +306,11 @@ static void PlaceTreeGroups(uint num_groups)
|
||||||
int y = GB(r, 8, 5) - GROVE_RADIUS;
|
int y = GB(r, 8, 5) - GROVE_RADIUS;
|
||||||
TileIndex cur_tile = TileAddWrap(center_tile, x, y);
|
TileIndex cur_tile = TileAddWrap(center_tile, x, y);
|
||||||
|
|
||||||
if (cur_tile != INVALID_TILE && CanPlantTreesOnTile(cur_tile, true)) {
|
if (cur_tile == INVALID_TILE) continue;
|
||||||
if(IsPointInStarShapedPolygon(x, y, grove)) {
|
if (!CanPlantTreesOnTile(cur_tile, true)) continue;
|
||||||
PlaceTree(cur_tile, r);
|
if (!IsPointInStarShapedPolygon(x, y, grove)) continue;
|
||||||
}
|
|
||||||
}
|
PlaceTree(cur_tile, r);
|
||||||
}
|
}
|
||||||
|
|
||||||
} while (--num_groups);
|
} while (--num_groups);
|
||||||
|
|
Loading…
Reference in New Issue