aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/mapblock.cpp9
1 files changed, 8 insertions, 1 deletions
diff --git a/src/mapblock.cpp b/src/mapblock.cpp
index f52a5ee3f..d94955a3b 100644
--- a/src/mapblock.cpp
+++ b/src/mapblock.cpp
@@ -366,12 +366,19 @@ void MapBlock::actuallyUpdateDayNightDiff()
/*
Check if any lighting value differs
*/
+
+ MapNode previous_n;
for (u32 i = 0; i < nodecount; i++) {
- MapNode &n = data[i];
+ MapNode n = data[i];
+
+ // If node is identical to previous node, don't verify if it differs
+ if (n == previous_n)
+ continue;
differs = !n.isLightDayNightEq(nodemgr);
if (differs)
break;
+ previous_n = n;
}
/*