From 459c02548e7f864795d8392a8709d09672866c0c Mon Sep 17 00:00:00 2001 From: Vanessa Ezekowitz Date: Fri, 31 Mar 2017 12:59:26 -0400 Subject: [PATCH] don't crash if placing bed on top of bed when not in auto-color mode. --- homedecor/handlers/expansion.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/homedecor/handlers/expansion.lua b/homedecor/handlers/expansion.lua index 9028f3e1..2c9b7ddd 100644 --- a/homedecor/handlers/expansion.lua +++ b/homedecor/handlers/expansion.lua @@ -237,7 +237,7 @@ function homedecor.bed_expansion(pos, placer, itemstack, pointed_thing, trybunks local newparam2 = param2 % 8 if inv:contains_item("main", lastdye) then minetest.set_node(toppos, { name = thisnode.name, param2 = param2}) - inv:remove_item("main", lastdye.." 1") + if lastdye then inv:remove_item("main", lastdye.." 1") end else minetest.set_node(toppos, { name = thisnode.name, param2 = newparam2}) minetest.chat_send_player(placer_name, "Ran out of "..lastdye..", using neutral color.")