limit bulk upgrades to ten

This commit is contained in:
theFox6 2023-10-20 18:44:45 +02:00
parent 0403820d39
commit 8e86685f5b
No known key found for this signature in database
GPG Key ID: 810803FF29A86CCC

@ -182,7 +182,14 @@ local io_device_base = {
else
max_allowed = math.min(stack:get_count(), 5)
end
elseif item ~= "microexpansion:upgrade_bulk" then
elseif item == "microexpansion:upgrade_bulk" then
local bulk_upgrades = me.count_upgrades(minetest.get_meta(pos):get_inventory()).bulk
if bulk_upgrades then
max_allowed = math.max(0, math.min(stack:get_count(), 10 - bulk_upgrades))
else
max_allowed = math.min(stack:get_count(), 10)
end
else
return 0
end
end