summaryrefslogtreecommitdiffstats
path: root/source/cRoot.cpp
diff options
context:
space:
mode:
authormadmaxoft@gmail.com <madmaxoft@gmail.com@0a769ca7-a7f5-676a-18bf-c427514a06d6>2012-06-19 22:31:21 +0200
committermadmaxoft@gmail.com <madmaxoft@gmail.com@0a769ca7-a7f5-676a-18bf-c427514a06d6>2012-06-19 22:31:21 +0200
commit602c2ec1b1dbd923b61113dfe9d6f6fffd619159 (patch)
treefd431c2cd3116075e64d11a7df16c48a80648b2f /source/cRoot.cpp
parentFixed a possible crash when restarting / stopping the server. (diff)
downloadcuberite-602c2ec1b1dbd923b61113dfe9d6f6fffd619159.tar
cuberite-602c2ec1b1dbd923b61113dfe9d6f6fffd619159.tar.gz
cuberite-602c2ec1b1dbd923b61113dfe9d6f6fffd619159.tar.bz2
cuberite-602c2ec1b1dbd923b61113dfe9d6f6fffd619159.tar.lz
cuberite-602c2ec1b1dbd923b61113dfe9d6f6fffd619159.tar.xz
cuberite-602c2ec1b1dbd923b61113dfe9d6f6fffd619159.tar.zst
cuberite-602c2ec1b1dbd923b61113dfe9d6f6fffd619159.zip
Diffstat (limited to 'source/cRoot.cpp')
-rw-r--r--source/cRoot.cpp6
1 files changed, 4 insertions, 2 deletions
diff --git a/source/cRoot.cpp b/source/cRoot.cpp
index 9feff537d..f4816d79c 100644
--- a/source/cRoot.cpp
+++ b/source/cRoot.cpp
@@ -289,8 +289,9 @@ 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 )
+ for (WorldMap::iterator itr = m_pState->WorldsByName.begin(), itr2 = itr; itr != m_pState->WorldsByName.end(); itr = itr2)
{
+ ++itr2;
if (a_Callback.Item(itr->second))
{
return false;
@@ -379,8 +380,9 @@ void cRoot::SaveAllChunks(void)
bool cRoot::ForEachPlayer(cPlayerListCallback & a_Callback)
{
- for (WorldMap::iterator itr = m_pState->WorldsByName.begin(); itr != m_pState->WorldsByName.end(); ++itr)
+ for (WorldMap::iterator itr = m_pState->WorldsByName.begin(), itr2 = itr; itr != m_pState->WorldsByName.end(); itr = itr2)
{
+ ++itr2;
if (!itr->second->ForEachPlayer(a_Callback))
{
return false;