mirror of
https://github.com/Kelsidavis/WoWee.git
synced 2026-04-17 17:43:52 +00:00
fix: send GAMEOBJ_USE+LOOT together for chests, reset off-screen bag pos
Chest-type GOs now send CMSG_GAMEOBJ_USE immediately followed by CMSG_LOOT in the same frame. The USE handler opens the chest, then the LOOT handler reads the contents — both processed sequentially by the server. Previously only CMSG_LOOT was sent (no USE), which failed on AzerothCore because the chest wasn't activated first. Reset the Bags window position to bottom-right if the saved position is outside the current screen resolution (e.g. after a resolution change or moving between monitors).
This commit is contained in:
parent
8a617e842b
commit
b10c8b7aea
2 changed files with 14 additions and 6 deletions
|
|
@ -21335,12 +21335,12 @@ void GameHandler::performGameObjectInteractionNow(uint64_t guid) {
|
||||||
" name='", goName, "' chestLike=", chestLike, " isMailbox=", isMailbox);
|
" name='", goName, "' chestLike=", chestLike, " isMailbox=", isMailbox);
|
||||||
|
|
||||||
if (chestLike) {
|
if (chestLike) {
|
||||||
// For chest-like GOs (quest objects, treasure chests, etc.), send CMSG_LOOT
|
// For chest-like GOs: send CMSG_GAMEOBJ_USE (opens the chest) followed
|
||||||
// directly with the GO GUID — same as creature corpse looting. The server's
|
// immediately by CMSG_LOOT (requests loot contents). Both sent in the
|
||||||
// LOOT handler activates the GO, generates loot, and sends SMSG_LOOT_RESPONSE
|
// same frame so the server processes them sequentially: USE transitions
|
||||||
// in a single step. Sending CMSG_GAMEOBJ_USE + delayed CMSG_LOOT doesn't work
|
// the GO to lootable state, then LOOT reads the contents.
|
||||||
// because the USE handler opens+despawns the GO before CMSG_LOOT arrives, and
|
auto usePacket = GameObjectUsePacket::build(guid);
|
||||||
// CMSG_LOOT's DoLootRelease() closes any loot the USE handler already opened.
|
socket->send(usePacket);
|
||||||
lootTarget(guid);
|
lootTarget(guid);
|
||||||
lastInteractedGoGuid_ = guid;
|
lastInteractedGoGuid_ = guid;
|
||||||
} else {
|
} else {
|
||||||
|
|
|
||||||
|
|
@ -941,6 +941,14 @@ void InventoryScreen::renderAggregateBags(game::Inventory& inventory, uint64_t m
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Reset to bottom-right if the window ended up outside the screen (resolution change)
|
||||||
|
ImVec2 winPos = ImGui::GetWindowPos();
|
||||||
|
ImVec2 winSize = ImGui::GetWindowSize();
|
||||||
|
if (winPos.x > screenW || winPos.y > screenH ||
|
||||||
|
winPos.x + winSize.x < 0 || winPos.y + winSize.y < 0) {
|
||||||
|
ImGui::SetWindowPos(ImVec2(posX, posY));
|
||||||
|
}
|
||||||
|
|
||||||
renderBackpackPanel(inventory, compactBags_);
|
renderBackpackPanel(inventory, compactBags_);
|
||||||
|
|
||||||
ImGui::Spacing();
|
ImGui::Spacing();
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue