From e44caf50eaa5aee56354bf0f330c653b78971cbe Mon Sep 17 00:00:00 2001 From: Relintai Date: Fri, 16 Apr 2021 21:34:39 +0200 Subject: [PATCH] Fix indexing. --- meshers/blocky/terra_mesher_blocky.cpp | 4 ++-- meshers/blocky/terra_mesher_liquid_blocky.cpp | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/meshers/blocky/terra_mesher_blocky.cpp b/meshers/blocky/terra_mesher_blocky.cpp index 67c1487..93a360d 100644 --- a/meshers/blocky/terra_mesher_blocky.cpp +++ b/meshers/blocky/terra_mesher_blocky.cpp @@ -302,7 +302,7 @@ void TerraMesherBlocky::_add_chunk(Ref p_chunk) { } */ //z + 1 - if (neighbours[4] == 0) { + if (neighbours[2] == 0) { if (use_lighting) { light = Color(channel_color_r[indexzp] / 255.0, channel_color_g[indexzp] / 255.0, @@ -362,7 +362,7 @@ void TerraMesherBlocky::_add_chunk(Ref p_chunk) { } //z - 1 - if (neighbours[5] == 0) { + if (neighbours[3] == 0) { if (use_lighting) { light = Color(channel_color_r[indexzn] / 255.0, channel_color_g[indexzn] / 255.0, diff --git a/meshers/blocky/terra_mesher_liquid_blocky.cpp b/meshers/blocky/terra_mesher_liquid_blocky.cpp index 61a4f8d..2881d06 100644 --- a/meshers/blocky/terra_mesher_liquid_blocky.cpp +++ b/meshers/blocky/terra_mesher_liquid_blocky.cpp @@ -350,7 +350,7 @@ void TerraMesherLiquidBlocky::_add_chunk(Ref p_chunk) { } */ //z + 1 - if (neighbours[4] == 0) { + if (neighbours[2] == 0) { if (use_lighting) { light = Color(channel_color_r[indexzp] / 255.0, channel_color_g[indexzp] / 255.0, @@ -410,7 +410,7 @@ void TerraMesherLiquidBlocky::_add_chunk(Ref p_chunk) { } //z - 1 - if (neighbours[5] == 0) { + if (neighbours[3] == 0) { if (use_lighting) { light = Color(channel_color_r[indexzn] / 255.0, channel_color_g[indexzn] / 255.0,