mirror of
https://github.com/luanti-org/luanti.git
synced 2025-06-27 16:36:03 +00:00
allow specifying a fixed seed in the config file for generating the map (fixed_map_seed)
This commit is contained in:
parent
c68ea19e8d
commit
570a8dbf22
2 changed files with 12 additions and 4 deletions
15
src/map.cpp
15
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
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue