mirror of
https://github.com/theFox6/microexpansion.git
synced 2024-11-21 23:03:42 +01:00
limit bulk upgrades to ten
This commit is contained in:
parent
0403820d39
commit
8e86685f5b
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user