From aa02e526c6001343e9cb3f06d391258b91237c8d Mon Sep 17 00:00:00 2001 From: FaceDeer Date: Tue, 5 Sep 2017 19:44:09 -0600 Subject: [PATCH] guard against glow worm/water interaction crash It appears that the ABM that destroys glow worms doesn't always remove them from the next light-kills check, resulting in this code being called on an air node. --- plants.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/plants.lua b/plants.lua index 8f5782d..4507d68 100644 --- a/plants.lua +++ b/plants.lua @@ -186,7 +186,7 @@ if dfcaverns.config.light_kills_fungus then local dead_node = node_def._dfcaverns_dead_node or "dfcaverns:dead_fungus" -- 11 is the value adjacent to a torch local light_level = minetest.get_node_light(pos) - if light_level and light_level > node_def.groups.light_sensitive_fungus then + if light_level and node_def.groups.light_sensitive_fungus and light_level > node_def.groups.light_sensitive_fungus then minetest.set_node(pos, {name=dead_node, param2 = node.param2}) end end