summaryrefslogtreecommitdiffstats
path: root/src/Root.cpp
diff options
context:
space:
mode:
authorTiger Wang <ziwei.tiger@hotmail.co.uk>2014-07-20 11:46:45 +0200
committerTiger Wang <ziwei.tiger@hotmail.co.uk>2014-07-20 11:46:45 +0200
commit6ab9afd0fd808fad99cd8387c72ce461c37aef80 (patch)
treec7fdd4f7cdc75b4958c297e55e2801510654ee76 /src/Root.cpp
parentFix failed merge and other issues (diff)
downloadcuberite-6ab9afd0fd808fad99cd8387c72ce461c37aef80.tar
cuberite-6ab9afd0fd808fad99cd8387c72ce461c37aef80.tar.gz
cuberite-6ab9afd0fd808fad99cd8387c72ce461c37aef80.tar.bz2
cuberite-6ab9afd0fd808fad99cd8387c72ce461c37aef80.tar.lz
cuberite-6ab9afd0fd808fad99cd8387c72ce461c37aef80.tar.xz
cuberite-6ab9afd0fd808fad99cd8387c72ce461c37aef80.tar.zst
cuberite-6ab9afd0fd808fad99cd8387c72ce461c37aef80.zip
Diffstat (limited to 'src/Root.cpp')
-rw-r--r--src/Root.cpp9
1 files changed, 7 insertions, 2 deletions
diff --git a/src/Root.cpp b/src/Root.cpp
index 822be92ff..e1eebb711 100644
--- a/src/Root.cpp
+++ b/src/Root.cpp
@@ -322,7 +322,7 @@ cWorld * cRoot::CreateAndInitializeWorld(const AString & a_WorldName, eDimension
}
cWorld * NewWorld = new cWorld(a_WorldName.c_str(), a_Dimension, a_OverworldName);
m_WorldsByName[a_WorldName] = NewWorld;
- NewWorld->Start(!a_OverworldName.empty());
+ NewWorld->Start();
NewWorld->InitializeSpawn();
m_PluginManager->CallHookWorldStarted(*NewWorld);
return NewWorld;
@@ -381,13 +381,18 @@ cWorld * cRoot::GetDefaultWorld()
-cWorld * cRoot::GetWorld(const AString & a_WorldName)
+cWorld * cRoot::GetWorld(const AString & a_WorldName, bool a_SearchForFolder)
{
WorldMap::iterator itr = m_WorldsByName.find(a_WorldName);
if (itr != m_WorldsByName.end())
{
return itr->second;
}
+
+ if (a_SearchForFolder && cFile::IsFolder(FILE_IO_PREFIX + a_WorldName))
+ {
+ return CreateAndInitializeWorld(a_WorldName);
+ }
return NULL;
}