From d303a60e110bbecd29ab65fb6173e77891a413e6 Mon Sep 17 00:00:00 2001 From: "madmaxoft@gmail.com" Date: Sun, 5 May 2013 11:42:09 +0000 Subject: ChunkDesc: Added heightmap verification (DEBUG-only), not used yet git-svn-id: http://mc-server.googlecode.com/svn/trunk@1443 0a769ca7-a7f5-676a-18bf-c427514a06d6 --- source/Generating/ChunkDesc.cpp | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) (limited to 'source/Generating/ChunkDesc.cpp') diff --git a/source/Generating/ChunkDesc.cpp b/source/Generating/ChunkDesc.cpp index 68feb463d..ff331e6e4 100644 --- a/source/Generating/ChunkDesc.cpp +++ b/source/Generating/ChunkDesc.cpp @@ -547,3 +547,30 @@ void cChunkDesc::CompressBlockMetas(cChunkDef::BlockNibbles & a_DestMetas) + +#ifdef _DEBUG + +void cChunkDesc::VerifyHeightmap(void) +{ + for (int x = 0; x < cChunkDef::Width; x++) + { + for (int z = 0; z < cChunkDef::Width; z++) + { + for (int y = cChunkDef::Height - 1; y > 0; y--) + { + if (GetBlockType(x, y, z) != E_BLOCK_AIR) + { + ASSERT(GetHeight(x, z) == y); + break; + } + } // for y + } // for z + } // for x +} + +#endif // _DEBUG + + + + + -- cgit v1.2.3