mirror of
https://github.com/theFox6/microexpansion.git
synced 2024-11-22 07:03:45 +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
|
else
|
||||||
max_allowed = math.min(stack:get_count(), 5)
|
max_allowed = math.min(stack:get_count(), 5)
|
||||||
end
|
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
|
return 0
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
Loading…
Reference in New Issue
Block a user