From 1f5ac183a9592713eae42ff96e6bac90f3291425 Mon Sep 17 00:00:00 2001 From: Emerson Rosen-Jones Date: Mon, 15 Sep 2025 20:15:11 -0400 Subject: [PATCH] Fixing some unwanted hunting behavior with compacting-storage.lua --- compacting-storage.lua | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/compacting-storage.lua b/compacting-storage.lua index 1b5d36d..7943108 100644 --- a/compacting-storage.lua +++ b/compacting-storage.lua @@ -129,8 +129,14 @@ function should_fill (type, counts) amount_needed = diff end else - fill_src = form - amount_spare = counts[form] + -- if the source is higher priority and using it would put it under + -- the fill limit, don't use it as a source + if fill_dest == nil and diff > -AMOUNT_USED then + -- do nothing + else + fill_src = form + amount_spare = counts[form] + end end if fill_src ~= nil and fill_dest ~= nil then break end end