From 48bf44c72d0adf8f2466a5a33b4601be5cdad6ad Mon Sep 17 00:00:00 2001 From: sfan5 Date: Sat, 28 Mar 2020 00:40:38 +0100 Subject: [PATCH] Fix minY/maxY calculation (closes #66) --- TileGenerator.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/TileGenerator.cpp b/TileGenerator.cpp index c264e00..7870016 100644 --- a/TileGenerator.cpp +++ b/TileGenerator.cpp @@ -563,7 +563,7 @@ void TileGenerator::renderMapBlock(const BlockDecoder &blk, const BlockPos &pos) int xBegin = (pos.x - m_xMin) * 16; int zBegin = (m_zMax - pos.z) * 16; int minY = (pos.y * 16 > m_yMin) ? 0 : m_yMin - pos.y * 16; - int maxY = (pos.y * 16 < m_yMax) ? 15 : m_yMax - pos.y * 16; + int maxY = (pos.y * 16 + 15 < m_yMax) ? 15 : m_yMax - pos.y * 16; for (int z = 0; z < 16; ++z) { int imageY = zBegin + 15 - z; for (int x = 0; x < 16; ++x) {