summaryrefslogtreecommitdiffstats
path: root/source/cWorld.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/cWorld.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 '')
-rw-r--r--source/cWorld.cpp6
1 files changed, 4 insertions, 2 deletions
diff --git a/source/cWorld.cpp b/source/cWorld.cpp
index b9731d96c..e438760af 100644
--- a/source/cWorld.cpp
+++ b/source/cWorld.cpp
@@ -1515,8 +1515,9 @@ bool cWorld::ForEachPlayer(cPlayerListCallback & a_Callback)
{
// Calls the callback for each player in the list
cCSLock Lock(m_CSPlayers);
- for (cPlayerList::iterator itr = m_Players.begin(); itr != m_Players.end(); ++itr)
+ for (cPlayerList::iterator itr = m_Players.begin(), itr2 = itr; itr != m_Players.end(); itr = itr2)
{
+ ++itr2;
if (a_Callback.Item(*itr))
{
return false;
@@ -1658,8 +1659,9 @@ void cWorld::MoveEntityToChunk(cEntity * a_Entity, int a_ChunkX, int a_ChunkY, i
bool cWorld::ForEachEntity(cEntityCallback & a_Callback)
{
cCSLock Lock(m_CSEntities);
- for (cEntityList::iterator itr = m_AllEntities.begin(); itr != m_AllEntities.end(); ++itr )
+ for (cEntityList::iterator itr = m_AllEntities.begin(), itr2 = itr; itr != m_AllEntities.end(); itr = itr2)
{
+ ++itr2;
if (a_Callback.Item(*itr))
{
return false;