Mailbox : drop unecessary conditions

This commit is contained in:
jp 2015-11-26 16:36:02 +01:00
parent cc829021fc
commit 5675a518ef

View File

@ -70,15 +70,11 @@ xdecor.register("mailbox", {
local function img_col(stack)
if not stack then return "" end
if stack.type == "node" then
if stack.inventory_image ~= "" then
return stack.inventory_image:match("([%w_]+)%.png")..".png"
else
return stack.tiles[1]:match("([%w_]+)%.png")..".png"
end
elseif stack.type == "tool" or stack.type == "craft" then
if stack.inventory_image ~= "" then
return stack.inventory_image:match("([%w_]+)%.png")..".png"
else return "" end
else
return stack.tiles[1]:match("([%w_]+)%.png")..".png"
end
end
function mailbox.formspec(pos, owner, num)