summaryrefslogtreecommitdiffstats
path: root/src/Root.cpp
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--src/Root.cpp6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/Root.cpp b/src/Root.cpp
index b793cb154..b65e9b067 100644
--- a/src/Root.cpp
+++ b/src/Root.cpp
@@ -314,10 +314,12 @@ void cRoot::LoadWorlds(cIniFile & IniFile)
cWorld * cRoot::CreateAndInitializeWorld(const AString & a_WorldName, eDimension a_Dimension, const AString & a_OverworldName)
{
- if (m_WorldsByName[a_WorldName] != NULL)
+ cWorld * World = m_WorldsByName[a_WorldName];
+ if (World != NULL)
{
- return NULL;
+ return World;
}
+
cWorld * NewWorld = new cWorld(a_WorldName.c_str(), a_Dimension, a_OverworldName);
m_WorldsByName[a_WorldName] = NewWorld;
NewWorld->Start();