From 605b8c5d942df8e78f1fc5bbf6a1079d6f5c2117 Mon Sep 17 00:00:00 2001 From: Christian Doczkal <20443222+chdoc@users.noreply.github.com> Date: Fri, 26 Jan 2024 23:01:22 +0100 Subject: [PATCH] [item] fix enumeration of (present) item type ids --- changelog.txt | 1 + item.lua | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/changelog.txt b/changelog.txt index df497e8f08..27a7fc8205 100644 --- a/changelog.txt +++ b/changelog.txt @@ -18,6 +18,7 @@ Template for new versions: ## Fixes - `makeown`: fix error when adopting units that need a historical figure to be created +- `item`: fix missing item categories when using ``--by-type`` ## Misc Improvements diff --git a/item.lua b/item.lua index a743a596c0..9f66a4e44f 100644 --- a/item.lua +++ b/item.lua @@ -296,7 +296,7 @@ function executeWithPrinting (action, conditions, options) end if options.bytype and count > 0 then local sorted = {} - for tp, ct in ipairs(types) do + for tp, ct in pairs(types) do table.insert(sorted, { type = tp, count = ct }) end table.sort(sorted, function(a, b) return a.count > b.count end)