Small fix for custom recipe

This commit is contained in:
Jean-Patrick Guerrero 2019-09-11 17:47:44 +02:00
parent 06bef9777a
commit 7c891ff2b6

View File

@ -202,9 +202,17 @@ function craftguide.register_craft(def)
local len = #def.items local len = #def.items
for i = 1, len do for i = 1, len do
def.items[i] = def.items[i]:gsub(",,", ", ,") local cc = 1
local rlen = #split(def.items[i], ",") for char in gmatch(def.items[i], ".") do
if char == "," and sub(def.items[i], cc, cc) == "," then
def.items[i] = sub(def.items[i], 1, cc) .. " " ..
sub(def.items[i], cc + 1)
end
cc = cc + 1
end
local rlen = #split(def.items[i], ",")
if rlen > def.width then if rlen > def.width then
def.width = rlen def.width = rlen
end end