fix: gossip/vendor windows not closing when opening mailbox/trainer/taxi

Domain handlers were setting `owner_.gossipWindowOpen = false` directly
on GameHandler's stale member, but isGossipWindowOpen() delegates to
QuestHandler's copy. The gossip window stayed open because the
delegating getter never saw the close.

Fix: use owner_.closeGossip() / owner_.closeVendor() which properly
delegate to QuestHandler/InventoryHandler to close the canonical state.

Affected: InventoryHandler (3 sites: mail, trainer, bank opening),
MovementHandler (1 site: taxi opening), QuestHandler (2 sites: gossip
opening closes vendor).
This commit is contained in:
Kelsi 2026-03-28 14:36:14 -07:00
parent e5959dceb5
commit 504d112625
3 changed files with 6 additions and 6 deletions

View file

@ -1289,7 +1289,7 @@ void InventoryHandler::useItemById(uint32_t itemId) {
void InventoryHandler::handleListInventory(network::Packet& packet) {
if (!ListInventoryParser::parse(packet, currentVendorItems_)) return;
vendorWindowOpen_ = true;
owner_.gossipWindowOpen = false;
owner_.closeGossip();
if (owner_.addonEventCallback_) owner_.addonEventCallback_("MERCHANT_SHOW", {});
// Auto-sell grey items
@ -1394,7 +1394,7 @@ void InventoryHandler::handleTrainerList(network::Packet& packet) {
const bool isClassic = isClassicLikeExpansion();
if (!TrainerListParser::parse(packet, currentTrainerList_, isClassic)) return;
trainerWindowOpen_ = true;
owner_.gossipWindowOpen = false;
owner_.closeGossip();
if (owner_.addonEventCallback_) owner_.addonEventCallback_("TRAINER_SHOW", {});
LOG_INFO("Trainer list: ", currentTrainerList_.spells.size(), " spells");
@ -1897,7 +1897,7 @@ void InventoryHandler::handleAuctionHello(network::Packet& packet) {
auctionHouseId_ = houseId;
auctionOpen_ = true;
auctionActiveTab_ = 0;
owner_.gossipWindowOpen = false;
owner_.closeGossip();
if (owner_.addonEventCallback_) owner_.addonEventCallback_("AUCTION_HOUSE_SHOW", {});
}