aboutsummaryrefslogtreecommitdiff
path: root/src/mapblock_mesh.cpp
diff options
context:
space:
mode:
authorVitaliy <silverunicorn2011@yandex.ru>2018-03-03 12:58:45 +0300
committerSmallJoker <SmallJoker@users.noreply.github.com>2018-03-03 10:58:45 +0100
commitf5fd4a0af1fef2e9cd3f7f368884349013a06dcc (patch)
treebb6a4ff4e7973c8c04b273e453fac57a94ce04fe /src/mapblock_mesh.cpp
parente7f16119913f7b2c98059398085d410684c9d8c0 (diff)
downloadhax-minetest-server-f5fd4a0af1fef2e9cd3f7f368884349013a06dcc.tar.gz
hax-minetest-server-f5fd4a0af1fef2e9cd3f7f368884349013a06dcc.zip
Cleanup in flat lighting (#7051)
Diffstat (limited to '')
-rw-r--r--src/mapblock_mesh.cpp14
1 files changed, 2 insertions, 12 deletions
diff --git a/src/mapblock_mesh.cpp b/src/mapblock_mesh.cpp
index 48171c84c..bdf791c0b 100644
--- a/src/mapblock_mesh.cpp
+++ b/src/mapblock_mesh.cpp
@@ -130,18 +130,8 @@ static u8 getInteriorLight(enum LightBank bank, MapNode n, s32 increment,
const NodeDefManager *ndef)
{
u8 light = n.getLight(bank, ndef);
-
- while(increment > 0)
- {
- light = undiminish_light(light);
- --increment;
- }
- while(increment < 0)
- {
- light = diminish_light(light);
- ++increment;
- }
-
+ if (light > 0)
+ light = rangelim(light + increment, 0, LIGHT_SUN);
return decode_light(light);
}