From a7a310f4ddd89826355661ad4a2f560ae5ca42eb Mon Sep 17 00:00:00 2001 From: Kevin Chabowski Date: Thu, 19 Sep 2013 00:52:20 +0200 Subject: Fixed bug in fix{Freeze,Melt} Since glass does not reduce the light level the height map does not give us the highest non-air block, if that block is glass, because the height map saves the block with the highest Y value that could get full sunlight. This will slow down fixing the weather conditions, but now snow can not fall through glass. --- region_wrapper.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/region_wrapper.go b/region_wrapper.go index a56f8dd..2f8abe4 100644 --- a/region_wrapper.go +++ b/region_wrapper.go @@ -243,7 +243,7 @@ func (rw *RegionWrapper) GetBiomeAt(x, z int) (mcmap.Biome, bool) { } func fixFreeze(bx, bz int, chunk *mcmap.Chunk) (newcol *gdk.Color) { - for y := chunk.Height(bx, bz); y >= 0; y-- { + for y := mcmap.ChunkSizeY - 1; y >= 0; y-- { if blk := chunk.Block(bx, y, bz); blk.ID != mcmap.BlkAir { if (blk.ID == mcmap.BlkStationaryWater) || (blk.ID == mcmap.BlkWater) { blk.ID = mcmap.BlkIce @@ -265,7 +265,7 @@ func fixFreeze(bx, bz int, chunk *mcmap.Chunk) (newcol *gdk.Color) { } func fixMelt(bx, bz int, chunk *mcmap.Chunk) (newcol *gdk.Color) { - for y := chunk.Height(bx, bz); y >= 0; y-- { + for y := mcmap.ChunkSizeY - 1; y >= 0; y-- { if blk := chunk.Block(bx, y, bz); blk.ID != mcmap.BlkAir { if blk.ID == mcmap.BlkIce { blk.ID = mcmap.BlkStationaryWater -- cgit v1.2.3-54-g00ecf