mirror of
https://github.com/minetest-mods/moreblocks.git
synced 2024-09-27 14:50:30 +02:00
Conserve left-over microblocks.
This commit conserves the microblocks so that they are never lost. Previously, any left-over microblocks were destroyed if the input box was manually emptied or if anything was taken from the output while the input box is empty.
This commit is contained in:
parent
832b8f8817
commit
e10536ee11
|
@ -154,16 +154,14 @@ function circular_saw:update_inventory(pos, amount)
|
||||||
return
|
return
|
||||||
end
|
end
|
||||||
|
|
||||||
|
-- Determine the kind of stairs from either the normal block or micro block.
|
||||||
local stack = inv:get_stack("input", 1)
|
local stack = inv:get_stack("input", 1)
|
||||||
-- At least one "normal" block is necessary to see what kind of stairs are requested.
|
local node_name = ""
|
||||||
if stack:is_empty() then
|
if stack:is_empty() then
|
||||||
-- Any microblocks not taken out yet are now lost.
|
node_name = inv:get_stack("micro", 1):get_name():gsub(":micro_", ":") or ""
|
||||||
-- (covers material loss in the machine)
|
else
|
||||||
self:reset(pos)
|
node_name = stack:get_name() or ""
|
||||||
return
|
|
||||||
|
|
||||||
end
|
end
|
||||||
local node_name = stack:get_name() or ""
|
|
||||||
local name_parts = circular_saw.known_nodes[node_name] or ""
|
local name_parts = circular_saw.known_nodes[node_name] or ""
|
||||||
local modname = name_parts[1] or ""
|
local modname = name_parts[1] or ""
|
||||||
local material = name_parts[2] or ""
|
local material = name_parts[2] or ""
|
||||||
|
|
Loading…
Reference in New Issue
Block a user