summaryrefslogtreecommitdiffstats
path: root/src/Root.cpp
diff options
context:
space:
mode:
authorTiger Wang <ziwei.tiger@hotmail.co.uk>2014-07-22 18:26:48 +0200
committerTiger Wang <ziwei.tiger@hotmail.co.uk>2014-07-22 18:26:48 +0200
commita28b0dc1201dca7c34d9a6c33232157e45a6d4f8 (patch)
treec904fd2faa10ed724e7229749b31ad6fe37fed9b /src/Root.cpp
parentSuggestion and failed merge fix (diff)
downloadcuberite-a28b0dc1201dca7c34d9a6c33232157e45a6d4f8.tar
cuberite-a28b0dc1201dca7c34d9a6c33232157e45a6d4f8.tar.gz
cuberite-a28b0dc1201dca7c34d9a6c33232157e45a6d4f8.tar.bz2
cuberite-a28b0dc1201dca7c34d9a6c33232157e45a6d4f8.tar.lz
cuberite-a28b0dc1201dca7c34d9a6c33232157e45a6d4f8.tar.xz
cuberite-a28b0dc1201dca7c34d9a6c33232157e45a6d4f8.tar.zst
cuberite-a28b0dc1201dca7c34d9a6c33232157e45a6d4f8.zip
Diffstat (limited to 'src/Root.cpp')
-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();