Ench. table : fix crash when clicking ench. button quickly after moved an enchanted tool

This commit is contained in:
kilbith 2016-02-04 21:57:46 +01:00
parent 73a135151c
commit 6a3b71d4b4

View File

@ -83,7 +83,7 @@ function enchanting.fields(pos, _, fields)
local mese = inv:get_stack("mese", 1)
local orig_wear = tool:get_wear()
local mod, name = tool:get_name():match("(.*):(.*)")
local enchanted_tool = mod..":enchanted_"..name.."_"..next(fields)
local enchanted_tool = (mod or "")..":enchanted_"..(name or "").."_"..next(fields)
if mese:get_count() >= mese_cost and minetest.registered_tools[enchanted_tool] then
tool:replace(enchanted_tool)