From 7d853c21802494d7e3fe0ce78373b2c8687c378e Mon Sep 17 00:00:00 2001 From: Andrey Stepanov Date: Mon, 4 Nov 2024 11:15:02 +0500 Subject: [PATCH] fix --- mapblockrenderer/renderer.go | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/mapblockrenderer/renderer.go b/mapblockrenderer/renderer.go index 2007348..84ca91b 100644 --- a/mapblockrenderer/renderer.go +++ b/mapblockrenderer/renderer.go @@ -149,7 +149,7 @@ func (r *MapBlockRenderer) Render(pos1, pos2 *types.MapBlockCoords) (*image.NRGB for x := 0; x < 16; x++ { for z := 0; z < 16; z++ { - var colors_stack [15]color.RGBA + var colors_stack [16]color.RGBA var visible_nodes_count uint8 = 0 for y := 15; y >= 0; y-- { if xzOccupationMap[x][z] { @@ -243,6 +243,10 @@ func (r *MapBlockRenderer) Render(pos1, pos2 *types.MapBlockCoords) (*image.NRGB } } + if visible_nodes_count == 0 { + continue + } + visible_nodes_count-- result_color := colors_stack[visible_nodes_count] if visible_nodes_count > 0 {