Speed-up the Work Table cutting function

This commit is contained in:
jp 2015-08-02 18:58:47 +02:00
parent 28c397044a
commit 5ee2a6da90

View File

@ -63,23 +63,18 @@ local function xfields(pos, formname, fields, sender)
local shape, get = {}, {}
local anz = 0
for m=1, #material do
for n=1, #def do
local v = material[m]
local w = def[n]
if (inputstack:get_name() == "default:"..v) and
(outputstack:get_count() < 99) and fields[w[1]] then
shape = "xdecor:"..w[1].."_"..v
anz = w[2]
for _, d in pairs(def) do
local nb, anz = d[1], d[2]
if outputstack:get_count() < 99 and fields[nb] then
shape = "xdecor:"..nb.."_"..string.sub(inputstack:get_name(), 9)
get = shape.." "..anz
if not minetest.registered_nodes[shape] then return end
inv:add_item("output", get)
inputstack:take_item()
inv:set_stack("input", 1, inputstack)
end
end
end
end
local function xdig(pos, player)