summaryrefslogtreecommitdiffstats
path: root/src/World.cpp
diff options
context:
space:
mode:
authorpeterbell10 <peterbell10@live.co.uk>2020-03-29 22:58:19 +0200
committerGitHub <noreply@github.com>2020-03-29 22:58:19 +0200
commit6116f899dee33a6d7bd887f7a57ace17df2ab94f (patch)
tree22dd17be6dd84e416124d6a3540feffd81613661 /src/World.cpp
parentCorrectly pass cache arguments to cmake in Jenkins build script (diff)
downloadcuberite-6116f899dee33a6d7bd887f7a57ace17df2ab94f.tar
cuberite-6116f899dee33a6d7bd887f7a57ace17df2ab94f.tar.gz
cuberite-6116f899dee33a6d7bd887f7a57ace17df2ab94f.tar.bz2
cuberite-6116f899dee33a6d7bd887f7a57ace17df2ab94f.tar.lz
cuberite-6116f899dee33a6d7bd887f7a57ace17df2ab94f.tar.xz
cuberite-6116f899dee33a6d7bd887f7a57ace17df2ab94f.tar.zst
cuberite-6116f899dee33a6d7bd887f7a57ace17df2ab94f.zip
Diffstat (limited to 'src/World.cpp')
-rw-r--r--src/World.cpp8
1 files changed, 6 insertions, 2 deletions
diff --git a/src/World.cpp b/src/World.cpp
index 2d0dfca9f..a08c269d8 100644
--- a/src/World.cpp
+++ b/src/World.cpp
@@ -2543,9 +2543,13 @@ std::unique_ptr<cPlayer> cWorld::RemovePlayer(cPlayer & a_Player)
#ifdef _DEBUG
bool cWorld::IsPlayerReferencedInWorldOrChunk(cPlayer & a_Player)
{
- if (m_ChunkMap->RemoveEntity(a_Player) != nullptr)
{
- return true;
+ cLock lock(*this);
+ auto * Chunk = a_Player.GetParentChunk();
+ if (Chunk && Chunk->HasEntity(a_Player.GetUniqueID()))
+ {
+ return true;
+ }
}
{