summaryrefslogtreecommitdiff
path: root/src/map.cpp
diff options
context:
space:
mode:
authorKahrl <kahrl@gmx.net>2011-08-31 11:24:50 +0200
committerPerttu Ahola <celeron55@gmail.com>2011-09-06 17:05:17 +0300
commit570a8dbf22e8e33fed22292941edfaa38d41c289 (patch)
treee9ca7b60679266f2636d9d9fd4e082637e54251e /src/map.cpp
parentc68ea19e8dd54c497b0fd3f16f26d063318e8bf6 (diff)
downloadminetest-570a8dbf22e8e33fed22292941edfaa38d41c289.tar.gz
minetest-570a8dbf22e8e33fed22292941edfaa38d41c289.tar.bz2
minetest-570a8dbf22e8e33fed22292941edfaa38d41c289.zip
allow specifying a fixed seed in the config file for generating the map (fixed_map_seed)
Diffstat (limited to 'src/map.cpp')
-rw-r--r--src/map.cpp15
1 files changed, 11 insertions, 4 deletions
diff --git a/src/map.cpp b/src/map.cpp
index 27a491428..4204c2a02 100644
--- a/src/map.cpp
+++ b/src/map.cpp
@@ -1879,10 +1879,17 @@ ServerMap::ServerMap(std::string savedir):
//m_chunksize = 8; // Takes a few seconds
- m_seed = (((u64)(myrand()%0xffff)<<0)
- + ((u64)(myrand()%0xffff)<<16)
- + ((u64)(myrand()%0xffff)<<32)
- + ((u64)(myrand()%0xffff)<<48));
+ 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));
+ }
+ else
+ {
+ m_seed = g_settings.getU64("fixed_map_seed");
+ }
/*
Experimental and debug stuff