summaryrefslogtreecommitdiffstats
path: root/src/Chunk.cpp
diff options
context:
space:
mode:
authorMattes D <github@xoft.cz>2015-06-30 14:08:21 +0200
committerMattes D <github@xoft.cz>2015-06-30 14:08:21 +0200
commitf6ab4613836dd031c2d118fc1e566fdc76814082 (patch)
treea9d434cc6f4837495858d5fc39d2683f2569152a /src/Chunk.cpp
parentFixed typos in the readme. (diff)
downloadcuberite-f6ab4613836dd031c2d118fc1e566fdc76814082.tar
cuberite-f6ab4613836dd031c2d118fc1e566fdc76814082.tar.gz
cuberite-f6ab4613836dd031c2d118fc1e566fdc76814082.tar.bz2
cuberite-f6ab4613836dd031c2d118fc1e566fdc76814082.tar.lz
cuberite-f6ab4613836dd031c2d118fc1e566fdc76814082.tar.xz
cuberite-f6ab4613836dd031c2d118fc1e566fdc76814082.tar.zst
cuberite-f6ab4613836dd031c2d118fc1e566fdc76814082.zip
Diffstat (limited to '')
-rw-r--r--src/Chunk.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/Chunk.cpp b/src/Chunk.cpp
index a3192f638..d9410dc8d 100644
--- a/src/Chunk.cpp
+++ b/src/Chunk.cpp
@@ -411,7 +411,7 @@ void cChunk::WriteBlockArea(cBlockArea & a_Area, int a_MinBlockX, int a_MinBlock
int OffZ = BlockStartZ - m_PosZ * cChunkDef::Width;
int BaseX = BlockStartX - a_MinBlockX;
int BaseZ = BlockStartZ - a_MinBlockZ;
- int SizeY = a_Area.GetSizeY();
+ int SizeY = std::min(a_Area.GetSizeY(), cChunkDef::Height - a_MinBlockY);
// TODO: Improve this by not calling FastSetBlock() and doing the processing here
// so that the heightmap is touched only once for each column.