diff --git a/src/mapblock.cpp b/src/mapblock.cpp
index ecd9a016b45d1d6fc010a699033cfce4b836c4b7..a05b7a4da4d7a51616372f305e15e624d11edc51 100644
--- a/src/mapblock.cpp
+++ b/src/mapblock.cpp
@@ -330,47 +330,42 @@ void MapBlock::copyFrom(VoxelManipulator &dst)
 void MapBlock::actuallyUpdateDayNightDiff()
 {
 	INodeDefManager *nodemgr = m_gamedef->ndef();
+
 	// Running this function un-expires m_day_night_differs
 	m_day_night_differs_expired = false;
 
-	if(data == NULL)
-	{
+	if (data == NULL) {
 		m_day_night_differs = false;
 		return;
 	}
 
-	bool differs = false;
+	bool differs;
 
 	/*
 		Check if any lighting value differs
 	*/
-	for(u32 i=0; i<MAP_BLOCKSIZE*MAP_BLOCKSIZE*MAP_BLOCKSIZE; i++)
-	{
+	for (u32 i = 0; i < MAP_BLOCKSIZE*MAP_BLOCKSIZE*MAP_BLOCKSIZE; i++) {
 		MapNode &n = data[i];
-		if(n.getLight(LIGHTBANK_DAY, nodemgr) != n.getLight(LIGHTBANK_NIGHT, nodemgr))
-		{
-			differs = true;
+
+		differs = !n.isLightDayNightEq(nodemgr);
+		if (differs)
 			break;
-		}
 	}
 
 	/*
 		If some lighting values differ, check if the whole thing is
-		just air. If it is, differ = false
+		just air. If it is just air, differs = false
 	*/
-	if(differs)
-	{
+	if (differs) {
 		bool only_air = true;
-		for(u32 i=0; i<MAP_BLOCKSIZE*MAP_BLOCKSIZE*MAP_BLOCKSIZE; i++)
-		{
+		for (u32 i = 0; i < MAP_BLOCKSIZE*MAP_BLOCKSIZE*MAP_BLOCKSIZE; i++) {
 			MapNode &n = data[i];
-			if(n.getContent() != CONTENT_AIR)
-			{
+			if (n.getContent() != CONTENT_AIR) {
 				only_air = false;
 				break;
 			}
 		}
-		if(only_air)
+		if (only_air)
 			differs = false;
 	}
 
diff --git a/src/mapnode.cpp b/src/mapnode.cpp
index 056b940548240b9d869b02f142fa3b7973ed949e..388071a17ad7d1c69321190990df71460b263831 100644
--- a/src/mapnode.cpp
+++ b/src/mapnode.cpp
@@ -74,6 +74,22 @@ void MapNode::setLight(enum LightBank bank, u8 a_light, INodeDefManager *nodemgr
 		assert(0);
 }
 
+bool MapNode::isLightDayNightEq(INodeDefManager *nodemgr) const
+{
+	const ContentFeatures &f = nodemgr->get(*this);
+	bool isEqual;
+
+	if (f.param_type == CPT_LIGHT) {
+		u8 day   = MYMAX(f.light_source, param1 & 0x0f);
+		u8 night = MYMAX(f.light_source, (param1 >> 4) & 0x0f);
+		isEqual = day == night;
+	} else {
+		isEqual = true;
+	}
+
+	return isEqual;
+}
+
 u8 MapNode::getLight(enum LightBank bank, INodeDefManager *nodemgr) const
 {
 	// Select the brightest of [light source, propagated light]
diff --git a/src/mapnode.h b/src/mapnode.h
index 82c53e7d4474b4fc86a9e11fe14e093f5f841cb8..b7d9f3acd6741ec1fab27a8534104fc0ad7ac46d 100644
--- a/src/mapnode.h
+++ b/src/mapnode.h
@@ -192,6 +192,14 @@ struct MapNode
 	}
 
 	void setLight(enum LightBank bank, u8 a_light, INodeDefManager *nodemgr);
+
+	/**
+	 * Check if the light value for night differs from the light value for day.
+	 *
+	 * @return If the light values are equal, returns true; otherwise false
+	 */
+	bool isLightDayNightEq(INodeDefManager *nodemgr) const;
+
 	u8 getLight(enum LightBank bank, INodeDefManager *nodemgr) const;
 
 	/**