mirror of
https://github.com/minetest-mods/mesecons.git
synced 2025-03-20 19:10:39 +01:00
Scanner: Also prevent high watermark from going to zero when % > 0
This commit is contained in:
parent
972a9914da
commit
a1c003bd61
@ -107,11 +107,14 @@ local function update_watermarks(pos, meta)
|
|||||||
local low = math.floor(i_size * (low_pct / 100.0))
|
local low = math.floor(i_size * (low_pct / 100.0))
|
||||||
local high = math.floor(i_size * (high_pct / 100.0))
|
local high = math.floor(i_size * (high_pct / 100.0))
|
||||||
|
|
||||||
-- We want low watermark % > 0 to enable output if a single slot has items
|
-- We want watermark % > 0 to enable output if a single slot has items
|
||||||
-- regardless of inventory size so add 1 to low here if needed.
|
-- regardless of inventory size so add 1 here if needed.
|
||||||
if low_pct > 0 and low == 0 then
|
if low_pct > 0 and low == 0 then
|
||||||
low = 1
|
low = 1
|
||||||
end
|
end
|
||||||
|
if high_pct > 0 and high == 0 then
|
||||||
|
high = 1
|
||||||
|
end
|
||||||
|
|
||||||
meta:set_int("low", low)
|
meta:set_int("low", low)
|
||||||
meta:set_int("high", high)
|
meta:set_int("high", high)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user