From d46d7807780529105ab9e66d9b73bccf1102b120 Mon Sep 17 00:00:00 2001 From: Zeffuro Date: Sun, 11 Jan 2026 17:43:10 +0100 Subject: [PATCH] Fix user categories --- .../Inventory/State/InventoryStateBase.cs | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) diff --git a/AetherBags/Inventory/State/InventoryStateBase.cs b/AetherBags/Inventory/State/InventoryStateBase.cs index c4d9cc1..23da550 100644 --- a/AetherBags/Inventory/State/InventoryStateBase.cs +++ b/AetherBags/Inventory/State/InventoryStateBase.cs @@ -19,6 +19,7 @@ public abstract class InventoryStateBase protected readonly List AllCategories = new(capacity: 256); protected readonly List FilteredCategories = new(capacity: 256); protected readonly List UserCategoriesSortedScratch = new(capacity: 64); + protected readonly List EnabledUserCategoriesScratch = new(capacity: 64); protected readonly List RemoveKeysScratch = new(capacity: 256); protected readonly HashSet ClaimedKeys = new(capacity: 512); @@ -69,18 +70,22 @@ public abstract class InventoryStateBase bool allaganCategoriesEnabled = config.Categories.AllaganToolsCategoriesEnabled && categoriesEnabled; bool bisCategoriesEnabled = config.Categories.BisBuddyEnabled && categoriesEnabled; // TODO: Cache this when config changes - UserCategoriesSortedScratch.Clear(); - foreach (var cat in config.Categories. UserCategories) + EnabledUserCategoriesScratch.Clear(); + foreach (var cat in config.Categories.UserCategories) { if (cat.Enabled) - UserCategoriesSortedScratch.Add(cat); + EnabledUserCategoriesScratch.Add(cat); } - var userCategories = UserCategoriesSortedScratch; - if (userCategoriesEnabled && userCategories.Count > 0) + if (userCategoriesEnabled && EnabledUserCategoriesScratch.Count > 0) { CategoryBucketManager.BucketByUserCategories( - ItemInfoByKey, userCategories, BucketsByKey, ClaimedKeys, UserCategoriesSortedScratch); + ItemInfoByKey, + EnabledUserCategoriesScratch, + BucketsByKey, + ClaimedKeys, + UserCategoriesSortedScratch + ); } if (allaganCategoriesEnabled)