From e5dec4dbb73ddcc92501babdb18df92a4aa55c60 Mon Sep 17 00:00:00 2001 From: Brues <5278969+brues-code@users.noreply.github.com> Date: Sun, 15 Nov 2026 16:36:46 -0600 Subject: [PATCH] fix(auctionhouse): don't post from a quiver or soul bag's free slot The multisell's free-slot search treated a bag as general-purpose when its item record's BagFamily field read 0. A vanilla quiver, ammo pouch or soul bag leaves that field empty (the family comes from its class/subclass), so those bags counted as general and a stack could be split into them. It now asks Item::BagFamily::BitmaskForRecord, the reader Container::Bag and C_Item.GetItemFamily already use. A bag whose record is not cached is still not trusted as general. --- src/auctionhouse/PostItem.cpp | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/auctionhouse/PostItem.cpp b/src/auctionhouse/PostItem.cpp index c34464d7..c7edf75a 100644 --- a/src/auctionhouse/PostItem.cpp +++ b/src/auctionhouse/PostItem.cpp @@ -61,6 +61,7 @@ #include "item/Record.h" #include "item/Swap.h" #include "tick/WorldTick.h" +#include "item/BagFamily.h" #include @@ -192,11 +193,13 @@ bool BagIsGeneral(int bag) { const int id = Item::ID::FromCGItem(bagItem); if (id == 0) return false; + // An uncached bag's family is unknown, so it is not trusted as general. const uint8_t *rec = Item::PeekRecord(static_cast(id)); if (rec == nullptr) return false; - return Game::Read( - rec, Offsets::OFF_ITEMSTATS_BAG_FAMILY) == 0; + // BitmaskForRecord, not the raw field: a vanilla quiver or soul bag leaves + // the field empty, and would otherwise read as general-purpose. + return Item::BagFamily::BitmaskForRecord(rec) == 0; } bool FindFreeGeneralSlot(void *L, int *outBag, int *outSlot) {