ChunkGenerator: Log world seed when creating a new one.
This commit is contained in:
parent
fac89d0c43
commit
bae928fd27
@ -52,10 +52,21 @@ bool cChunkGenerator::Start(cPluginInterface & a_PluginInterface, cChunkSink & a
|
|||||||
m_PluginInterface = &a_PluginInterface;
|
m_PluginInterface = &a_PluginInterface;
|
||||||
m_ChunkSink = &a_ChunkSink;
|
m_ChunkSink = &a_ChunkSink;
|
||||||
|
|
||||||
MTRand rnd;
|
// Get the seed; create a new one and log it if not found in the INI file:
|
||||||
m_Seed = a_IniFile.GetValueSetI("Seed", "Seed", (int)rnd.randInt());
|
if (a_IniFile.HasValue("Seed", "Seed"))
|
||||||
|
{
|
||||||
|
m_Seed = a_IniFile.GetValueI("Seed", "Seed");
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
MTRand rnd;
|
||||||
|
m_Seed = rnd.randInt();
|
||||||
|
LOGINFO("Chosen a new random seed for world: %d", m_Seed);
|
||||||
|
a_IniFile.SetValueI("Seed", "Seed", m_Seed);
|
||||||
|
}
|
||||||
|
|
||||||
|
// Get the generator engine based on the INI file settings:
|
||||||
AString GeneratorName = a_IniFile.GetValueSet("Generator", "Generator", "Composable");
|
AString GeneratorName = a_IniFile.GetValueSet("Generator", "Generator", "Composable");
|
||||||
|
|
||||||
if (NoCaseCompare(GeneratorName, "Noise3D") == 0)
|
if (NoCaseCompare(GeneratorName, "Noise3D") == 0)
|
||||||
{
|
{
|
||||||
m_Generator = new cNoise3DGenerator(*this);
|
m_Generator = new cNoise3DGenerator(*this);
|
||||||
|
Loading…
Reference in New Issue
Block a user