From 177b4366ecf7dab6070d288afc78168431d869f9 Mon Sep 17 00:00:00 2001 From: Oversword Date: Fri, 14 Jan 2022 04:38:16 +0000 Subject: [PATCH] Check if huds exist before removing them --- nodes_anvil.lua | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/nodes_anvil.lua b/nodes_anvil.lua index 9456ed1..489f5dc 100644 --- a/nodes_anvil.lua +++ b/nodes_anvil.lua @@ -230,8 +230,12 @@ minetest.register_node("cottages:anvil", { minetest.after(2, function() if( puncher ) then puncher:hud_remove(hud1); - puncher:hud_remove(hud2); - puncher:hud_remove(hud3); + if hud2 then + puncher:hud_remove(hud2); + end + if hud3 then + puncher:hud_remove(hud3); + end end end) @@ -300,4 +304,3 @@ minetest.register_craft({ {'cottages:anvil'}, {cottages.craftitem_stick} } }) -