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.
This commit is contained in:
Brues
2026-11-15 16:36:46 -06:00
parent 075525a3bb
commit e5dec4dbb7
+5 -2
View File
@@ -61,6 +61,7 @@
#include "item/Record.h"
#include "item/Swap.h"
#include "tick/WorldTick.h"
#include "item/BagFamily.h"
#include <cstdint>
@@ -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<uint32_t>(id));
if (rec == nullptr)
return false;
return Game::Read<uint32_t>(
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) {