summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorTiger Wang <ziwei.tiger@outlook.com>2020-08-28 22:32:46 +0200
committerTiger Wang <ziwei.tiger@outlook.com>2020-08-28 22:32:46 +0200
commit7023548de006843963d6f56dcc6541f7bf9676e1 (patch)
treedae0fa8bb09009595cc437cbc42655670577aee8 /src
parentClean up GenerateChunk/TouchChunk (diff)
downloadcuberite-7023548de006843963d6f56dcc6541f7bf9676e1.tar
cuberite-7023548de006843963d6f56dcc6541f7bf9676e1.tar.gz
cuberite-7023548de006843963d6f56dcc6541f7bf9676e1.tar.bz2
cuberite-7023548de006843963d6f56dcc6541f7bf9676e1.tar.lz
cuberite-7023548de006843963d6f56dcc6541f7bf9676e1.tar.xz
cuberite-7023548de006843963d6f56dcc6541f7bf9676e1.tar.zst
cuberite-7023548de006843963d6f56dcc6541f7bf9676e1.zip
Diffstat (limited to 'src')
-rw-r--r--src/Chunk.cpp10
-rw-r--r--src/ChunkMap.h2
2 files changed, 4 insertions, 8 deletions
diff --git a/src/Chunk.cpp b/src/Chunk.cpp
index 84c5e9fc5..ea9862c6a 100644
--- a/src/Chunk.cpp
+++ b/src/Chunk.cpp
@@ -724,12 +724,8 @@ void cChunk::MoveEntityToNewChunk(OwnedEntity a_Entity)
cChunk * Neighbor = GetNeighborChunk(a_Entity->GetChunkX() * cChunkDef::Width, a_Entity->GetChunkZ() * cChunkDef::Width);
if (Neighbor == nullptr)
{
- Neighbor = m_ChunkMap->GetChunk(a_Entity->GetChunkX(), a_Entity->GetChunkZ());
- if (Neighbor == nullptr) // This will assert inside GetChunk in debug builds
- {
- LOGWARNING("%s: Failed to move entity, destination chunk unreachable. Entity lost", __FUNCTION__);
- return;
- }
+ LOGWARNING("%s: Failed to move entity, destination chunk unreachable. Entity lost", __FUNCTION__);
+ return;
}
ASSERT(Neighbor != this); // Moving into the same chunk? wtf?
@@ -2151,7 +2147,7 @@ cChunk * cChunk::GetRelNeighborChunk(int a_RelX, int a_RelZ)
int BlockZ = m_PosZ * cChunkDef::Width + a_RelZ;
int ChunkX, ChunkZ;
BlockToChunk(BlockX, BlockZ, ChunkX, ChunkZ);
- return m_ChunkMap->GetChunkNoLoad(ChunkX, ChunkZ);
+ return m_ChunkMap->FindChunk(ChunkX, ChunkZ);
}
// Walk the neighbors:
diff --git a/src/ChunkMap.h b/src/ChunkMap.h
index 27794efa6..1b04ae3da 100644
--- a/src/ChunkMap.h
+++ b/src/ChunkMap.h
@@ -401,7 +401,7 @@ public:
private:
- // Chunks query their neighbors using GetChunk(), while being ticked
+ // Chunks query their neighbors using FindChunk(), while being ticked
friend class cChunk;
// The chunkstay can (de-)register itself using AddChunkStay() and DelChunkStay()