Fixing some unwanted hunting behavior with compacting-storage.lua

This commit is contained in:
Emerson Rosen-Jones 2025-09-15 20:15:11 -04:00
parent c949564c4a
commit 1f5ac183a9

View file

@ -128,10 +128,16 @@ function should_fill (type, counts)
fill_dest = form fill_dest = form
amount_needed = diff amount_needed = diff
end end
else
-- 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 else
fill_src = form fill_src = form
amount_spare = counts[form] amount_spare = counts[form]
end end
end
if fill_src ~= nil and fill_dest ~= nil then break end if fill_src ~= nil and fill_dest ~= nil then break end
end end
local amount_to_use = nil local amount_to_use = nil