1
0

Add DefaultWorld to newly generated INI

This commit is contained in:
LogicParrot 2016-02-08 12:26:21 +02:00
parent ed97946bb9
commit dd34243521

View File

@ -349,9 +349,9 @@ void cRoot::LoadGlobalSettings()
void cRoot::LoadWorlds(cSettingsRepositoryInterface & a_Settings, bool a_IsNewIniFile) void cRoot::LoadWorlds(cSettingsRepositoryInterface & a_Settings, bool a_IsNewIniFile)
{ {
// First get the default world
if (a_IsNewIniFile) if (a_IsNewIniFile)
{ {
a_Settings.AddValue("Worlds", "DefaultWorld", "world");
a_Settings.AddValue("Worlds", "World", "world_nether"); a_Settings.AddValue("Worlds", "World", "world_nether");
a_Settings.AddValue("Worlds", "World", "world_end"); a_Settings.AddValue("Worlds", "World", "world_end");
m_pDefaultWorld = new cWorld("world"); m_pDefaultWorld = new cWorld("world");
@ -361,6 +361,7 @@ void cRoot::LoadWorlds(cSettingsRepositoryInterface & a_Settings, bool a_IsNewIn
return; return;
} }
// First get the default world
AString DefaultWorldName = a_Settings.GetValueSet("Worlds", "DefaultWorld", "world"); AString DefaultWorldName = a_Settings.GetValueSet("Worlds", "DefaultWorld", "world");
m_pDefaultWorld = new cWorld(DefaultWorldName.c_str()); m_pDefaultWorld = new cWorld(DefaultWorldName.c_str());
m_WorldsByName[ DefaultWorldName ] = m_pDefaultWorld; m_WorldsByName[ DefaultWorldName ] = m_pDefaultWorld;