Check if huds exist before removing them

This commit is contained in:
Oversword 2022-01-14 04:38:16 +00:00
parent 0bb02ac904
commit 177b4366ec
1 changed files with 6 additions and 3 deletions

View File

@ -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} }
})