From 790456cbc4d6cc9157ec8809dae3ff1bd88760f4 Mon Sep 17 00:00:00 2001 From: Wuzzy Date: Thu, 29 Jun 2017 11:57:38 +0200 Subject: [PATCH] Fix crash w/ wall near unknown node --- mods/ITEMS/mcl_walls/init.lua | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/mods/ITEMS/mcl_walls/init.lua b/mods/ITEMS/mcl_walls/init.lua index 1465d29488..0e7818d507 100644 --- a/mods/ITEMS/mcl_walls/init.lua +++ b/mods/ITEMS/mcl_walls/init.lua @@ -40,7 +40,8 @@ local function update_wall(pos) for i = 1, 4 do local dir = directions[i] local node = minetest.get_node({x = pos.x + dir.x, y = pos.y + dir.y, z = pos.z + dir.z}) - if minetest.registered_nodes[node.name].walkable then + local def = minetest.registered_nodes[node.name] + if def and def.walkable then sum = sum + 2 ^ (i - 1) end end @@ -48,7 +49,8 @@ local function update_wall(pos) -- Torches or walkable nodes above the wall local upnode = minetest.get_node({x = pos.x, y = pos.y+1, z = pos.z}) if sum == 5 or sum == 10 then - if minetest.registered_nodes[upnode.name].walkable or upnode.name == "mcl_torches:torch" then + local def = minetest.registered_nodes[upnode.name] + if (def and def.walkable) or upnode.name == "mcl_torches:torch" then sum = sum + 11 end end