From 1326b9e7e7b6952b3aeabf27068ea1e491556465 Mon Sep 17 00:00:00 2001 From: kabou Date: Wed, 9 Mar 2022 15:14:22 +0100 Subject: [PATCH] Add check for unknown nodes. * Check if node has a definition table before attempting to evaluate its attributes. By application of De Morgan's law, the compound logic expression can be rewritten so that the existence of the table is checked before all following attribute references. --- mods/MAPGEN/mcl_structures/init.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mods/MAPGEN/mcl_structures/init.lua b/mods/MAPGEN/mcl_structures/init.lua index be1be0f67..f596147f0 100644 --- a/mods/MAPGEN/mcl_structures/init.lua +++ b/mods/MAPGEN/mcl_structures/init.lua @@ -179,7 +179,7 @@ function mcl_structures.generate_igloo(pos, rotation, pr) real_depth = real_depth + 1 local node = minetest.get_node({x=tpos.x,y=tpos.y-y,z=tpos.z}) local def = minetest.registered_nodes[node.name] - if (not def) or (not def.walkable) or (def.liquidtype ~= "none") or (not def.is_ground_content) then + if not (def and def.walkable and def.liquidtype == "none" and def.is_ground_content) then bpos.y = tpos.y-y+1 break end