diff options
author | red-001 <red-001@outlook.ie> | 2020-11-12 20:05:47 +0000 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-11-12 21:05:47 +0100 |
commit | 8eb2cbac613c92c1a7656ecb542e63fed9023061 (patch) | |
tree | 0d3d700df97916514ab614257b7bdce797b8ab49 /src/mapgen | |
parent | 68139a28eb8b43b3685b81c77258912ffc5e0b8f (diff) | |
download | minetest-8eb2cbac613c92c1a7656ecb542e63fed9023061.tar.gz minetest-8eb2cbac613c92c1a7656ecb542e63fed9023061.tar.bz2 minetest-8eb2cbac613c92c1a7656ecb542e63fed9023061.zip |
Fix warnings about an unused variables and implicit conversion (#10586)
Diffstat (limited to 'src/mapgen')
-rw-r--r-- | src/mapgen/mg_ore.cpp | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/src/mapgen/mg_ore.cpp b/src/mapgen/mg_ore.cpp index b50ed6a32..5814f433a 100644 --- a/src/mapgen/mg_ore.cpp +++ b/src/mapgen/mg_ore.cpp @@ -498,7 +498,11 @@ void OreVein::generate(MMVManip *vm, int mapseed, u32 blockseed, } // randval ranges from -1..1 - float randval = (float)pr.next() / (pr.RANDOM_RANGE / 2) - 1.f; + /* + Note: can generate values slightly larger than 1 + but this can't be changed as mapgen must be deterministic accross versions. + */ + float randval = (float)pr.next() / float(pr.RANDOM_RANGE / 2) - 1.f; float noiseval = contour(noise->result[index]); float noiseval2 = contour(noise2->result[index]); if (noiseval * noiseval2 + randval * random_factor < nthresh) |