From 912980fdb61453a2ea347bdd9936d08628d6d9ce Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Thu, 19 Mar 2026 05:24:52 +0000 Subject: [PATCH 1/2] Initial plan From c3cf347f550fc5f6c6ecaf33546c845ce8c555b2 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Thu, 19 Mar 2026 05:31:52 +0000 Subject: [PATCH 2/2] Fix: skip new-item-to-bottom processing for special packages like NEARLY_DYING_PACKAGE Co-authored-by: tinymins <1808990+tinymins@users.noreply.github.com> --- MY_BagEx/src/MY_BagEx_BagNewItem.lua | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/MY_BagEx/src/MY_BagEx_BagNewItem.lua b/MY_BagEx/src/MY_BagEx_BagNewItem.lua index cdb97908c..2038a263b 100644 --- a/MY_BagEx/src/MY_BagEx_BagNewItem.lua +++ b/MY_BagEx/src/MY_BagEx_BagNewItem.lua @@ -95,6 +95,19 @@ function D.CreateBagItemCache() end function D.OnBagItemUpdate(dwBox, dwX) + -- Only process items in regular package boxes, skip special packages (e.g., NEARLY_DYING_PACKAGE) + local aPackageBoxList = X.GetInventoryBoxList(X.CONSTANT.INVENTORY_TYPE.PACKAGE) + local bInPackage = false + for _, dwIterBox in ipairs(aPackageBoxList) do + if dwIterBox == dwBox then + bInPackage = true + break + end + end + if not bInPackage then + D.CreateBagItemCache() -- still refresh cache to keep it in sync + return + end local me = X.GetClientPlayer() local kItem = X.GetInventoryItem(me, dwBox, dwX) if kItem then