summaryrefslogtreecommitdiffstats
path: root/src/World.cpp
diff options
context:
space:
mode:
authorTiger Wang <ziwei.tiger@hotmail.co.uk>2014-07-29 21:50:30 +0200
committerTiger Wang <ziwei.tiger@hotmail.co.uk>2014-07-29 21:50:30 +0200
commit4f5d73b7704e351365a987b421c35f1384afa240 (patch)
tree88b4da666ea4723377cfa489c737618ef8cde2b1 /src/World.cpp
parentMerge pull request #1061 from mc-server/portals (diff)
downloadcuberite-4f5d73b7704e351365a987b421c35f1384afa240.tar
cuberite-4f5d73b7704e351365a987b421c35f1384afa240.tar.gz
cuberite-4f5d73b7704e351365a987b421c35f1384afa240.tar.bz2
cuberite-4f5d73b7704e351365a987b421c35f1384afa240.tar.lz
cuberite-4f5d73b7704e351365a987b421c35f1384afa240.tar.xz
cuberite-4f5d73b7704e351365a987b421c35f1384afa240.tar.zst
cuberite-4f5d73b7704e351365a987b421c35f1384afa240.zip
Diffstat (limited to '')
-rw-r--r--src/World.cpp6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/World.cpp b/src/World.cpp
index 0b0f7870b..84c0f2b93 100644
--- a/src/World.cpp
+++ b/src/World.cpp
@@ -2465,10 +2465,12 @@ void cWorld::AddPlayer(cPlayer * a_Player)
-void cWorld::RemovePlayer(cPlayer * a_Player)
+void cWorld::RemovePlayer(cPlayer * a_Player, bool a_RemoveFromChunk)
{
- if (!a_Player->IsWorldTravellingFrom(this))
+ if (a_RemoveFromChunk)
{
+ // To prevent iterator invalidations when an entity goes through a portal and calls this function whilst being ticked by cChunk
+ // we should not change cChunk's entity list if asked not to
m_ChunkMap->RemoveEntity(a_Player);
}
{