mirror of
https://github.com/Kelsidavis/WoWee.git
synced 2026-03-23 07:40:14 +00:00
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:
parent
811a2a97a8
commit
89ccb0720a
12 changed files with 191 additions and 9 deletions
|
|
@ -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;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue