mirror of
https://github.com/minetest-mods/drawers.git
synced 2024-11-22 22:53:46 +01:00
Fix 'automatic tool repair' bug, Don't add stack_max=1 items
This commit is contained in:
parent
e784ad6a17
commit
1b280c5442
10
init.lua
10
init.lua
@ -165,13 +165,19 @@ core.register_entity("drawers:visual", {
|
|||||||
if add_name ~= name then return end
|
if add_name ~= name then return end
|
||||||
else -- is empty
|
else -- is empty
|
||||||
name = add_name
|
name = add_name
|
||||||
meta:set_string("name", name)
|
|
||||||
count = 0
|
count = 0
|
||||||
|
|
||||||
-- get new stack max
|
-- get new stack max
|
||||||
base_stack_max = ItemStack(name):get_stack_max()
|
base_stack_max = ItemStack(name):get_stack_max()
|
||||||
meta:set_int("base_stack_max", base_stack_max)
|
|
||||||
max_count = base_stack_max * stack_max_factor
|
max_count = base_stack_max * stack_max_factor
|
||||||
|
|
||||||
|
-- Don't add items stackable only to 1
|
||||||
|
if base_stack_max == 1 then
|
||||||
|
return
|
||||||
|
end
|
||||||
|
|
||||||
|
meta:set_string("name", name)
|
||||||
|
meta:set_int("base_stack_max", base_stack_max)
|
||||||
meta:set_int("max_count", max_count)
|
meta:set_int("max_count", max_count)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user