Fix unknown items appearing in stack after closing formspec

This commit is contained in:
jp 2015-08-22 00:32:47 +02:00
parent b56c002a97
commit f0b023225b

View File

@ -35,7 +35,8 @@ function enchanting.fields(pos, _, fields, _)
local mese = mesestack:get_count()
local ench = dump(fields):match("%w+")
if enchanting.is_allowed(toolname) ~= 0 and mese > 0 and fields[ench] then
if enchanting.is_allowed(toolname) ~= 0 and mese > 0 and
fields[ench] and ench ~= "quit" then
toolstack:replace("xdecor:enchanted_"..toolname:sub(9).."_"..ench)
toolstack:add_wear(toolwear)
mesestack:take_item()