xdecor - crash avoiting: Added further sanity check and update formspecs
* backporting https://notabug.org/minenux/minetest-mod-xdecor/commit/3e0ca1304d454297739d6f8> * backporting https://github.com/0siribix/xdecor/commit/c7e756afc7d246817209c415c6e9a9dda533> * backporting https://github.com/0siribix/xdecor/commit/3823fce1e05a9472e7cf798c8346ba95ead1>
This commit is contained in:
parent
6c8dfbcaca
commit
9f62ed07c7
@ -108,6 +108,7 @@ function enchanting.fields(pos, _, fields, sender)
|
||||
local tool = inv:get_stack("tool", 1)
|
||||
local mese = inv:get_stack("mese", 1)
|
||||
local orig_wear = tool:get_wear()
|
||||
if tool and tool:get_name() and allowed_tools[tool:get_name()] then
|
||||
local mod, name = tool:get_name():match("(.*):(.*)")
|
||||
local enchanted_tool = (mod or "") .. ":enchanted_" .. (name or "") .. "_" .. next(fields)
|
||||
|
||||
@ -123,6 +124,8 @@ function enchanting.fields(pos, _, fields, sender)
|
||||
inv:set_stack("mese", 1, mese)
|
||||
inv:set_stack("tool", 1, tool)
|
||||
end
|
||||
enchanting.formspec(pos)
|
||||
end
|
||||
end
|
||||
|
||||
function enchanting.dig(pos)
|
||||
|
Loading…
x
Reference in New Issue
Block a user