From: kwolekr Date: Wed, 23 Jan 2013 15:13:04 +0000 (-0500) Subject: Improve random map seed generation X-Git-Url: http://81.2.79.47:8989/gitweb/?a=commitdiff_plain;h=a73905401aab774ec56425db54706ad1f862e9ad;p=zefram%2Fminetest%2Fminetest_engine.git Improve random map seed generation --- diff --git a/src/map.cpp b/src/map.cpp index ea82194b..ab9cb25d 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; }