diff options
author | Kevin Chabowski <kevin@kch42.de> | 2013-09-20 13:19:59 +0200 |
---|---|---|
committer | Kevin Chabowski <kevin@kch42.de> | 2013-09-20 13:19:59 +0200 |
commit | 8b3d36227baa6ce6da9033cd65e4a26679fdd2c2 (patch) | |
tree | 3b25a934e000ec8f366bec17ce0935e4b173a0f3 | |
parent | c29a154e5aeeb1240962b330fc2c8a8651cedd75 (diff) | |
download | gomcmap-8b3d36227baa6ce6da9033cd65e4a26679fdd2c2.tar.gz gomcmap-8b3d36227baa6ce6da9033cd65e4a26679fdd2c2.tar.bz2 gomcmap-8b3d36227baa6ce6da9033cd65e4a26679fdd2c2.zip |
Fixed bug in RecalcHeightMap
y started as ChunkSizeY which resulted in a index out of range panic.
-rw-r--r-- | mcmap/chunk.go | 2 |
1 files changed, 1 insertions, 1 deletions
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) |