mirror of
https://github.com/OpenRCT2/OpenRCT2
synced 2026-01-06 06:32:56 +01:00
Don't place trees when impossible
This commit is contained in:
@@ -346,7 +346,7 @@ static void mapgen_place_trees()
|
||||
|
||||
// Place trees
|
||||
float treeToLandRatio = (10 + (util_rand() % 30)) / 100.0f;
|
||||
sint32 numTrees = Math::Max(4, (sint32) (availablePositions.size() * treeToLandRatio));
|
||||
sint32 numTrees = Math::Clamp(4, (sint32) (availablePositions.size() * treeToLandRatio), (sint32)availablePositions.size());
|
||||
|
||||
for (sint32 i = 0; i < numTrees; i++)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user