summaryrefslogtreecommitdiffstats
path: root/src/Root.cpp
diff options
context:
space:
mode:
Diffstat (limited to '')
-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;
}