From 45330380ae920d1871171a83c5913a418f350ac9 Mon Sep 17 00:00:00 2001 From: Elias <39592174+foxxelias@users.noreply.github.com> Date: Tue, 13 Aug 2024 00:53:48 +0300 Subject: [PATCH 1/2] fixed wrong logical operator sequence --- empty-bin.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/empty-bin.lua b/empty-bin.lua index f94a14081..8e38c13d8 100644 --- a/empty-bin.lua +++ b/empty-bin.lua @@ -18,7 +18,7 @@ local function emptyContainer(container) print('Emptying ' .. dfhack.items.getReadableDescription(container)) local pos = xyz2pos(dfhack.items.getPosition(container)) for _, item in ipairs(items) do - local skip_liquid = item:getType() == df.item_type.LIQUID_MISC or item:getType() == df.item_type.DRINK and not options.liquids + local skip_liquid = not options.liquids and (item:getType() == df.item_type.LIQUID_MISC or item:getType() == df.item_type.DRINK) if skip_liquid then print(' ' .. dfhack.items.getReadableDescription(item) .. ' was skipped because the --liquids flag was not provided') else From 8f28742229dc8f2e24ed76091e0c7f790fd335ba Mon Sep 17 00:00:00 2001 From: Elias <39592174+foxxelias@users.noreply.github.com> Date: Tue, 13 Aug 2024 21:07:36 +0300 Subject: [PATCH 2/2] Update changelog.txt --- changelog.txt | 1 + 1 file changed, 1 insertion(+) diff --git a/changelog.txt b/changelog.txt index ff9254295..50b3369c4 100644 --- a/changelog.txt +++ b/changelog.txt @@ -36,6 +36,7 @@ Template for new versions: ## Fixes - `timestream`: ensure child growth events (e.g. becoming an adult) are not skipped over +- `empty-bin`: ``--liquids`` option correctly emptying containers filled with LIQUID_MISC ## Misc Improvements - `gui/sitemap`: show whether a unit is friendly, hostile, or wildlife