Skip to content
Snippets Groups Projects
Commit 6b71509f authored by Auke Kok's avatar Auke Kok
Browse files

Fix #86 - crash in workbench: `attempt to concatenate a nil value`

Caused by a keystroke used in the formspec - this causes all
these fields not to be set, and the subsequent crash.
parent 885d6398
No related branches found
No related tags found
No related merge requests found
......@@ -150,9 +150,11 @@ end
function workbench.fields(pos, _, fields)
if fields.quit then return end
local meta = minetest.get_meta(pos)
workbench:set_formspec(meta, fields.back and 1 or
fields.craft and 2 or
fields.storage and 3)
local id = fields.back and 1 or
fields.craft and 2 or
fields.storage and 3
if not id then return end
workbench:set_formspec(meta, id)
end
function workbench.dig(pos)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment