mirror of
https://github.com/minetest-mods/moreblocks.git
synced 2024-12-26 18:50:22 +01:00
Speedup remnant stack calculation
This commit is contained in:
parent
7bd98ac02c
commit
26799d2263
@ -93,9 +93,10 @@ function circular_saw:get_output_inv(modname, material, amount, max)
|
|||||||
|
|
||||||
for i, t in ipairs(circular_saw.names) do
|
for i, t in ipairs(circular_saw.names) do
|
||||||
local cost = circular_saw.cost_in_microblocks[i]
|
local cost = circular_saw.cost_in_microblocks[i]
|
||||||
|
local balance = math.min(math.floor(amount/cost), max)
|
||||||
pos = pos + 1
|
pos = pos + 1
|
||||||
list[pos] = modname .. ":" .. t[1] .. "_" .. material .. t[2]
|
list[pos] = modname .. ":" .. t[1] .. "_" .. material .. t[2]
|
||||||
.. " " .. math.min(math.floor(amount/cost), max)
|
.. " " .. balance
|
||||||
end
|
end
|
||||||
return list
|
return list
|
||||||
end
|
end
|
||||||
|
Loading…
Reference in New Issue
Block a user