mirror of
https://github.com/OpenRCT2/OpenRCT2
synced 2026-01-17 20:13:07 +01:00
Fix implicit floating point cast imprecision error
This commit is contained in:
@@ -364,7 +364,8 @@ static void mapgen_place_trees()
|
||||
}
|
||||
|
||||
// Use tree:land ratio except when near an oasis
|
||||
if (static_cast<float>(util_rand()) / 0xFFFFFFFF > std::max(treeToLandRatio, oasisScore))
|
||||
constexpr static auto randModulo = 0xFFFF;
|
||||
if (static_cast<float>(util_rand() & randModulo) / randModulo > std::max(treeToLandRatio, oasisScore))
|
||||
continue;
|
||||
|
||||
// Use fractal noise to group tiles that are likely to spawn trees together
|
||||
|
||||
Reference in New Issue
Block a user