diff options
author | worktycho <work.tycho@gmail.com> | 2015-06-30 15:04:31 +0200 |
---|---|---|
committer | worktycho <work.tycho@gmail.com> | 2015-06-30 15:04:31 +0200 |
commit | 351110fa3cc67e67b42f16e7941891bb51730d07 (patch) | |
tree | a9d434cc6f4837495858d5fc39d2683f2569152a /src/Chunk.cpp | |
parent | Fixed typos in the readme. (diff) | |
parent | BlockArea: Fixed a crash with areas higher than chunk height. (diff) | |
download | cuberite-351110fa3cc67e67b42f16e7941891bb51730d07.tar cuberite-351110fa3cc67e67b42f16e7941891bb51730d07.tar.gz cuberite-351110fa3cc67e67b42f16e7941891bb51730d07.tar.bz2 cuberite-351110fa3cc67e67b42f16e7941891bb51730d07.tar.lz cuberite-351110fa3cc67e67b42f16e7941891bb51730d07.tar.xz cuberite-351110fa3cc67e67b42f16e7941891bb51730d07.tar.zst cuberite-351110fa3cc67e67b42f16e7941891bb51730d07.zip |
Diffstat (limited to 'src/Chunk.cpp')
-rw-r--r-- | src/Chunk.cpp | 2 |
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. |