summaryrefslogtreecommitdiffstats
path: root/source/cRoot.cpp
diff options
context:
space:
mode:
authormadmaxoft@gmail.com <madmaxoft@gmail.com@0a769ca7-a7f5-676a-18bf-c427514a06d6>2012-06-02 11:38:51 +0200
committermadmaxoft@gmail.com <madmaxoft@gmail.com@0a769ca7-a7f5-676a-18bf-c427514a06d6>2012-06-02 11:38:51 +0200
commit1d6c55afcc31fdd9df6e9330c1e6812dfaf45a1a (patch)
tree7229f7a53d79c5736be4f11718a727d58555f535 /source/cRoot.cpp
parentFixed a nasty int overflow bug in blockticking code ( http://forum.mc-server.org/showthread.php?tid=457 ) (diff)
downloadcuberite-1d6c55afcc31fdd9df6e9330c1e6812dfaf45a1a.tar
cuberite-1d6c55afcc31fdd9df6e9330c1e6812dfaf45a1a.tar.gz
cuberite-1d6c55afcc31fdd9df6e9330c1e6812dfaf45a1a.tar.bz2
cuberite-1d6c55afcc31fdd9df6e9330c1e6812dfaf45a1a.tar.lz
cuberite-1d6c55afcc31fdd9df6e9330c1e6812dfaf45a1a.tar.xz
cuberite-1d6c55afcc31fdd9df6e9330c1e6812dfaf45a1a.tar.zst
cuberite-1d6c55afcc31fdd9df6e9330c1e6812dfaf45a1a.zip
Diffstat (limited to '')
-rw-r--r--source/cRoot.cpp25
1 files changed, 16 insertions, 9 deletions
diff --git a/source/cRoot.cpp b/source/cRoot.cpp
index d110c96a3..fd3132f28 100644
--- a/source/cRoot.cpp
+++ b/source/cRoot.cpp
@@ -247,15 +247,6 @@ void cRoot::UnloadWorlds()
-cWorld* cRoot::GetWorld()
-{
- return GetDefaultWorld();
-}
-
-
-
-
-
cWorld* cRoot::GetDefaultWorld()
{
return m_pState->pDefaultWorld;
@@ -277,6 +268,22 @@ cWorld* cRoot::GetWorld( const AString & a_WorldName )
+bool cRoot::ForEachWorld(cWorldListCallback & a_Callback)
+{
+ for( WorldMap::iterator itr = m_pState->WorldsByName.begin(); itr != m_pState->WorldsByName.end(); ++itr )
+ {
+ if (a_Callback.Item(itr->second))
+ {
+ return false;
+ }
+ }
+ return true;
+}
+
+
+
+
+
void cRoot::TickWorlds( float a_Dt )
{
for( WorldMap::iterator itr = m_pState->WorldsByName.begin(); itr != m_pState->WorldsByName.end(); ++itr )