Add bag bar drag-to-reorder, fix three wrong WotLK opcodes

Bag bar: left-click drag bags to swap positions using CMSG_SWAP_ITEM
with INVENTORY_SLOT_BAG_0 (255). Local optimistic swap for instant
feedback. Camera controller now respects ImGui WantCaptureMouse.
Vendor auto-open bags only triggers once per session.

Fix opcodes: CMSG_GAMEOBJECT_USE 0x01B→0x0B1 (typo caused
SMSG_FORCEACTIONSHOW spam), CMSG_CANCEL_AURA 0x033→0x136,
SMSG_SELL_ITEM 0x1A4→0x1A1.
This commit is contained in:
Kelsi 2026-02-19 22:34:22 -08:00
parent 328ec9ea78
commit 38ad368c82
9 changed files with 168 additions and 48 deletions

View file

@ -115,6 +115,12 @@ void Inventory::setBankBagSize(int bagIndex, int size) {
bankBags_[bagIndex].size = std::min(size, MAX_BAG_SIZE);
}
void Inventory::swapBagContents(int bagA, int bagB) {
if (bagA < 0 || bagA >= NUM_BAG_SLOTS || bagB < 0 || bagB >= NUM_BAG_SLOTS) return;
if (bagA == bagB) return;
std::swap(bags[bagA], bags[bagB]);
}
int Inventory::findFreeBackpackSlot() const {
for (int i = 0; i < BACKPACK_SLOTS; i++) {
if (backpack[i].empty()) return i;