Scanner: Also prevent high watermark from going to zero when % > 0

This commit is contained in:
Johannes Lundberg 2020-10-09 10:19:54 -07:00
parent 972a9914da
commit a1c003bd61
1 changed files with 5 additions and 2 deletions

View File

@ -107,11 +107,14 @@ local function update_watermarks(pos, meta)
local low = math.floor(i_size * (low_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
-- regardless of inventory size so add 1 to low here if needed.
-- We want watermark % > 0 to enable output if a single slot has items
-- regardless of inventory size so add 1 here if needed.
if low_pct > 0 and low == 0 then
low = 1
end
if high_pct > 0 and high == 0 then
high = 1
end
meta:set_int("low", low)
meta:set_int("high", high)