aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorkwolekr <kwolekr@minetest.net>2015-01-12 15:46:04 -0500
committerkwolekr <kwolekr@minetest.net>2015-01-12 15:46:04 -0500
commitb0efb8f3b23596699f37e1a88ea093a82bd15b0a (patch)
tree67cef75b906c9bace77a9bb8f74aa1cf4ce2ed71
parentc367f7301a4bd2f69a84b53392439482abd6dc5a (diff)
downloadminetest-b0efb8f3b23596699f37e1a88ea093a82bd15b0a.tar.gz
minetest-b0efb8f3b23596699f37e1a88ea093a82bd15b0a.tar.bz2
minetest-b0efb8f3b23596699f37e1a88ea093a82bd15b0a.zip
Prevent transform of noise3d result in getBlockSeed2
-rw-r--r--src/mapgen.cpp4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/mapgen.cpp b/src/mapgen.cpp
index 3f83d2178..ef3daf305 100644
--- a/src/mapgen.cpp
+++ b/src/mapgen.cpp
@@ -112,7 +112,9 @@ u32 Mapgen::getBlockSeed(v3s16 p, int seed)
u32 Mapgen::getBlockSeed2(v3s16 p, int seed)
{
- return noise3d(p.X, p.Y, p.Z, seed);
+ u32 n = 1619 * p.X + 31337 * p.Y + 52591 * p.Z + 1013 * seed;
+ n = (n >> 13) ^ n;
+ return (n * (n * n * 60493 + 19990303) + 1376312589);
}