Fix vanilla spell casting and bag contents

Vanilla CMSG_CAST_SPELL target mask is uint16 (not uint32 like WotLK),
the extra 2 bytes were corrupting packets. Also implement full bag
content tracking: extract container slot GUIDs from CONTAINER update
objects, set proper bag sizes, and populate bag items in inventory
rebuild.
This commit is contained in:
Kelsi 2026-02-13 22:14:34 -08:00
parent 811a2a97a8
commit 89ccb0720a
12 changed files with 191 additions and 9 deletions

View file

@ -50,6 +50,11 @@ int Inventory::getBagSize(int bagIndex) const {
return bags[bagIndex].size;
}
void Inventory::setBagSize(int bagIndex, int size) {
if (bagIndex < 0 || bagIndex >= NUM_BAG_SLOTS) return;
bags[bagIndex].size = std::min(size, MAX_BAG_SIZE);
}
const ItemSlot& Inventory::getBagSlot(int bagIndex, int slotIndex) const {
if (bagIndex < 0 || bagIndex >= NUM_BAG_SLOTS) return EMPTY_SLOT;
if (slotIndex < 0 || slotIndex >= bags[bagIndex].size) return EMPTY_SLOT;