From f5fd4a0af1fef2e9cd3f7f368884349013a06dcc Mon Sep 17 00:00:00 2001 From: Vitaliy Date: Sat, 3 Mar 2018 12:58:45 +0300 Subject: Cleanup in flat lighting (#7051) --- src/mapblock_mesh.cpp | 14 ++------------ 1 file changed, 2 insertions(+), 12 deletions(-) (limited to 'src/mapblock_mesh.cpp') 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); } -- cgit v1.2.3