aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorkwolekr <mirrorisim@gmail.com>2013-01-23 10:13:04 -0500
committerkwolekr <mirrorisim@gmail.com>2013-02-06 01:10:37 -0500
commita73905401aab774ec56425db54706ad1f862e9ad (patch)
tree6ddc8316674234af1d582d51f3558392dcb72ebb
parent2868676693d59939ca075be1371f5384fb4fda17 (diff)
downloadminetest-a73905401aab774ec56425db54706ad1f862e9ad.tar.gz
minetest-a73905401aab774ec56425db54706ad1f862e9ad.tar.bz2
minetest-a73905401aab774ec56425db54706ad1f862e9ad.zip
Improve random map seed generation
-rw-r--r--src/map.cpp8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/map.cpp b/src/map.cpp
index ea82194b8..ab9cb25dd 100644
--- a/src/map.cpp
+++ b/src/map.cpp
@@ -2013,10 +2013,10 @@ ServerMap::ServerMap(std::string savedir, IGameDef *gamedef, EmergeManager *emer
if (g_settings->get("fixed_map_seed").empty())
{
- m_seed = (((u64)(myrand()%0xffff)<<0)
- + ((u64)(myrand()%0xffff)<<16)
- + ((u64)(myrand()%0xffff)<<32)
- + ((u64)(myrand()&0xffff)<<48));
+ m_seed = (((u64)(myrand() & 0xffff) << 0)
+ | ((u64)(myrand() & 0xffff) << 16)
+ | ((u64)(myrand() & 0xffff) << 32)
+ | ((u64)(myrand() & 0xffff) << 48));
m_mgparams->seed = m_seed;
}