From 8b3d36227baa6ce6da9033cd65e4a26679fdd2c2 Mon Sep 17 00:00:00 2001 From: Kevin Chabowski Date: Fri, 20 Sep 2013 13:19:59 +0200 Subject: Fixed bug in RecalcHeightMap y started as ChunkSizeY which resulted in a index out of range panic. --- mcmap/chunk.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mcmap/chunk.go b/mcmap/chunk.go index 6f78fdc..6f6c4db 100644 --- a/mcmap/chunk.go +++ b/mcmap/chunk.go @@ -118,7 +118,7 @@ func (c *Chunk) RecalcHeightMap() { i := 0 for z := 0; z < ChunkSizeXZ; z++ { for x := 0; x < ChunkSizeXZ; x++ { - for y := ChunkSizeY; y >= 0; y-- { + for y := ChunkSizeY-1; y >= 0; y-- { blkid := c.blocks[calcBlockOffset(x, y, z)].ID if (blkid != BlkAir) && (blkid != BlkGlass) && (blkid != BlkGlassPane) { c.heightMap[i] = int32(y) -- cgit v1.2.3-70-g09d2