mirror of https://github.com/OpenRCT2/OpenRCT2.git
Fix implicit floating point cast imprecision error
This commit is contained in:
parent
7471cb319f
commit
ad61343a83
|
@ -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
|
||||
|
|
Loading…
Reference in New Issue