From a1c003bd61ca3cb4a3393b5cedc64bec599911cf Mon Sep 17 00:00:00 2001 From: Johannes Lundberg Date: Fri, 9 Oct 2020 10:19:54 -0700 Subject: [PATCH] Scanner: Also prevent high watermark from going to zero when % > 0 --- mesecons_scanner/init.lua | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/mesecons_scanner/init.lua b/mesecons_scanner/init.lua index 95f77e7..cbdd4eb 100644 --- a/mesecons_scanner/init.lua +++ b/mesecons_scanner/init.lua @@ -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)