summaryrefslogtreecommitdiff
path: root/src/nodedef.h
diff options
context:
space:
mode:
authorJude Melton-Houghton <jwmhjwmh@gmail.com>2022-03-29 12:06:44 -0400
committerGitHub <noreply@github.com>2022-03-29 18:06:44 +0200
commit11aab4198be1a0f1104a433896e908e4c86de0c9 (patch)
tree5c3086fe6790fde7475e0ea3397c81d1cae564e8 /src/nodedef.h
parent8d387433b14791db95e59127b5e6e30f58155c1e (diff)
downloadminetest-11aab4198be1a0f1104a433896e908e4c86de0c9.tar.gz
minetest-11aab4198be1a0f1104a433896e908e4c86de0c9.tar.bz2
minetest-11aab4198be1a0f1104a433896e908e4c86de0c9.zip
Optimize swapping nodes with equivalent lighting
Diffstat (limited to 'src/nodedef.h')
-rw-r--r--src/nodedef.h6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/nodedef.h b/src/nodedef.h
index ea50d4281..f90caff8a 100644
--- a/src/nodedef.h
+++ b/src/nodedef.h
@@ -478,6 +478,12 @@ struct ContentFeatures
return (liquid_alternative_flowing_id == f.liquid_alternative_flowing_id);
}
+ bool lightingEquivalent(const ContentFeatures &other) const {
+ return light_propagates == other.light_propagates
+ && sunlight_propagates == other.sunlight_propagates
+ && light_source == other.light_source;
+ }
+
int getGroup(const std::string &group) const
{
return itemgroup_get(groups, group);