aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorsapier <Sapier at GMX dot net>2014-06-30 22:56:08 +0200
committersapier <Sapier at GMX dot net>2014-06-30 22:56:08 +0200
commitbfaba2c12a9eb00a602c12f9724c8701842cc385 (patch)
treeca9306f3c6e8a15bd1ef291179199a5351712203
parent9afeb97fc693a769f2d9dad4aad6ddbdef285a71 (diff)
downloadminetest-bfaba2c12a9eb00a602c12f9724c8701842cc385.tar.gz
minetest-bfaba2c12a9eb00a602c12f9724c8701842cc385.tar.bz2
minetest-bfaba2c12a9eb00a602c12f9724c8701842cc385.zip
Fix regression in light calculation
-rw-r--r--src/mapblock_mesh.cpp5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/mapblock_mesh.cpp b/src/mapblock_mesh.cpp
index bcc4cba5c..21d431cd1 100644
--- a/src/mapblock_mesh.cpp
+++ b/src/mapblock_mesh.cpp
@@ -258,8 +258,8 @@ static u8 getSmoothLight(enum LightBank bank, v3s16 p, MeshMakeData *data)
{
MapNode n = data->m_vmanip.getNodeNoEx(p - dirs8[i]);
+ // if it's CONTENT_IGNORE we can't do any light calculations
if (n.getContent() == CONTENT_IGNORE) {
- ambient_occlusion++;
continue;
}
@@ -273,6 +273,9 @@ static u8 getSmoothLight(enum LightBank bank, v3s16 p, MeshMakeData *data)
light += decode_light(n.getLight(bank, ndef));
light_count++;
}
+ else {
+ ambient_occlusion++;
+ }
}
if(light_count == 0)