BlockArea: Fixed a crash with areas higher than chunk height.

This commit is contained in:
Mattes D
2015-06-30 14:08:21 +02:00
parent e86f593c37
commit f6ab461383
2 changed files with 8 additions and 2 deletions
+1 -1
View File
@@ -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.