From f6ab4613836dd031c2d118fc1e566fdc76814082 Mon Sep 17 00:00:00 2001 From: Mattes D Date: Tue, 30 Jun 2015 14:08:21 +0200 Subject: BlockArea: Fixed a crash with areas higher than chunk height. --- src/Chunk.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/Chunk.cpp') 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. -- cgit v1.2.3