Mailbox : use a different pattern regex

This commit is contained in:
jp 2015-11-26 15:55:55 +01:00
parent 7c824cd827
commit 52e8a46524

View File

@ -72,12 +72,12 @@ local function img_col(stack)
if not stack then return "" end if not stack then return "" end
if stack.type == "node" then if stack.type == "node" then
if stack.inventory_image ~= "" then if stack.inventory_image ~= "" then
return string.match(stack.inventory_image, "([%w_]+)")..".png" return stack.inventory_image:match("([%w_]+)%.png")..".png"
else else
return string.match(stack.tiles[1], "([%w_]+)")..".png" return stack.tiles[1]:match("([%w_]+)%.png")..".png"
end end
elseif stack.type == "tool" or stack.type == "craft" then elseif stack.type == "tool" or stack.type == "craft" then
return string.match(stack.inventory_image, "([%w_]+)")..".png" return stack.inventory_image:match("([%w_]+)%.png")..".png"
else return "" end else return "" end
end end