summaryrefslogtreecommitdiffstats
path: root/src/Root.cpp
diff options
context:
space:
mode:
authorTiger Wang <ziwei.tiger@hotmail.co.uk>2014-05-31 23:28:51 +0200
committerTiger Wang <ziwei.tiger@hotmail.co.uk>2014-05-31 23:28:51 +0200
commit8bff3e5af220070ecc789ef551c0b8428b8953ef (patch)
tree4e0b04d1595f8441a9ca5f319ea94244143294db /src/Root.cpp
parentVery minor code changes (diff)
downloadcuberite-8bff3e5af220070ecc789ef551c0b8428b8953ef.tar
cuberite-8bff3e5af220070ecc789ef551c0b8428b8953ef.tar.gz
cuberite-8bff3e5af220070ecc789ef551c0b8428b8953ef.tar.bz2
cuberite-8bff3e5af220070ecc789ef551c0b8428b8953ef.tar.lz
cuberite-8bff3e5af220070ecc789ef551c0b8428b8953ef.tar.xz
cuberite-8bff3e5af220070ecc789ef551c0b8428b8953ef.tar.zst
cuberite-8bff3e5af220070ecc789ef551c0b8428b8953ef.zip
Diffstat (limited to 'src/Root.cpp')
-rw-r--r--src/Root.cpp21
1 files changed, 13 insertions, 8 deletions
diff --git a/src/Root.cpp b/src/Root.cpp
index c82b05a66..2a80baeb3 100644
--- a/src/Root.cpp
+++ b/src/Root.cpp
@@ -320,7 +320,7 @@ cWorld * cRoot::CreateAndInitializeWorld(const AString & a_WorldName)
{
return NULL;
}
- cWorld* NewWorld = new cWorld(a_WorldName.c_str());
+ cWorld * NewWorld = new cWorld(a_WorldName.c_str());
m_WorldsByName[a_WorldName] = NewWorld;
NewWorld->Start();
NewWorld->InitializeSpawn();
@@ -372,7 +372,7 @@ void cRoot::UnloadWorlds(void)
-cWorld* cRoot::GetDefaultWorld()
+cWorld * cRoot::GetDefaultWorld()
{
return m_pDefaultWorld;
}
@@ -381,12 +381,14 @@ cWorld* cRoot::GetDefaultWorld()
-cWorld* cRoot::GetWorld( const AString & a_WorldName )
+cWorld * cRoot::GetWorld(const AString & a_WorldName)
{
- WorldMap::iterator itr = m_WorldsByName.find( a_WorldName );
- if( itr != m_WorldsByName.end() )
+ WorldMap::iterator itr = m_WorldsByName.find(a_WorldName);
+ if (itr != m_WorldsByName.end())
+ {
return itr->second;
- return 0;
+ }
+ return NULL;
}
@@ -398,9 +400,12 @@ bool cRoot::ForEachWorld(cWorldListCallback & a_Callback)
for (WorldMap::iterator itr = m_WorldsByName.begin(), itr2 = itr; itr != m_WorldsByName.end(); itr = itr2)
{
++itr2;
- if (a_Callback.Item(itr->second))
+ if (itr->second != NULL)
{
- return false;
+ if (a_Callback.Item(itr->second))
+ {
+ return false;
+ }
}
}
return true;