summaryrefslogtreecommitdiffstats
path: root/src/ChunkMap.cpp
diff options
context:
space:
mode:
authorTiger Wang <ziwei.tiger@outlook.com>2021-05-05 15:25:10 +0200
committerGitHub <noreply@github.com>2021-05-05 15:25:10 +0200
commita62b2b1be2103d7de2fd66c7304b7473e369be3c (patch)
treea44f2b43fd90f5c79af5e308b554349e6dc546af /src/ChunkMap.cpp
parentRename files to match code (diff)
downloadcuberite-a62b2b1be2103d7de2fd66c7304b7473e369be3c.tar
cuberite-a62b2b1be2103d7de2fd66c7304b7473e369be3c.tar.gz
cuberite-a62b2b1be2103d7de2fd66c7304b7473e369be3c.tar.bz2
cuberite-a62b2b1be2103d7de2fd66c7304b7473e369be3c.tar.lz
cuberite-a62b2b1be2103d7de2fd66c7304b7473e369be3c.tar.xz
cuberite-a62b2b1be2103d7de2fd66c7304b7473e369be3c.tar.zst
cuberite-a62b2b1be2103d7de2fd66c7304b7473e369be3c.zip
Diffstat (limited to '')
-rw-r--r--src/ChunkMap.cpp6
1 files changed, 5 insertions, 1 deletions
diff --git a/src/ChunkMap.cpp b/src/ChunkMap.cpp
index 669a4f564..9e39338de 100644
--- a/src/ChunkMap.cpp
+++ b/src/ChunkMap.cpp
@@ -748,6 +748,10 @@ bool cChunkMap::GetBlocks(sSetBlockVector & a_Blocks, bool a_ContinueOnFailure)
res = false;
continue;
}
+ if (!cChunkDef::IsValidHeight(itr->m_RelY))
+ {
+ continue;
+ }
itr->m_BlockType = Chunk->GetBlock(itr->m_RelX, itr->m_RelY, itr->m_RelZ);
itr->m_BlockMeta = Chunk->GetMeta(itr->m_RelX, itr->m_RelY, itr->m_RelZ);
}
@@ -798,7 +802,7 @@ cItems cChunkMap::PickupsFromBlock(Vector3i a_BlockPos, const cEntity * a_Digger
-void cChunkMap::SendBlockTo(int a_X, int a_Y, int a_Z, cPlayer & a_Player)
+void cChunkMap::SendBlockTo(int a_X, int a_Y, int a_Z, const cPlayer & a_Player)
{
int ChunkX, ChunkZ;
cChunkDef::AbsoluteToRelative(a_X, a_Y, a_Z, ChunkX, ChunkZ);