fix: auction house refresh failed after browse-all (empty name search)

The auto-refresh after successful bid/buyout was gated on
lastAuctionSearch_.name.length() > 0, so a browse-all search (empty
name) would never refresh. Replaced with a hasAuctionSearch_ flag
that's set on any search regardless of the name filter.
This commit is contained in:
Kelsi 2026-03-29 19:01:06 -07:00
parent a2340dd702
commit 2e1f0f15ea
2 changed files with 5 additions and 2 deletions

View file

@ -374,6 +374,7 @@ private:
uint32_t offset = 0;
};
AuctionSearchParams lastAuctionSearch_;
bool hasAuctionSearch_ = false; // true after any search (including empty-name browse-all)
enum class AuctionResultTarget { BROWSE, OWNER, BIDDER };
AuctionResultTarget pendingAuctionTarget_ = AuctionResultTarget::BROWSE;

View file

@ -1834,6 +1834,7 @@ void InventoryHandler::auctionSearch(const std::string& name, uint8_t levelMin,
uint32_t invTypeMask, uint8_t usableOnly, uint32_t offset) {
if (owner_.state != WorldState::IN_WORLD || !owner_.socket || auctioneerGuid_ == 0) return;
lastAuctionSearch_ = {name, levelMin, levelMax, quality, itemClass, itemSubClass, invTypeMask, usableOnly, offset};
hasAuctionSearch_ = true;
pendingAuctionTarget_ = AuctionResultTarget::BROWSE;
auto packet = AuctionListItemsPacket::build(auctioneerGuid_, offset, name,
levelMin, levelMax, invTypeMask,
@ -1946,8 +1947,9 @@ void InventoryHandler::handleAuctionCommandResult(network::Packet& packet) {
owner_.addonEventCallback_("PLAYER_MONEY", {});
owner_.addonEventCallback_("BAG_UPDATE", {});
}
// Re-query after successful buy/bid
if (action == 2 && lastAuctionSearch_.name.length() > 0) {
// Re-query after successful buy/bid so the list reflects the change.
// Previously gated on name.length()>0 which skipped browse-all (empty name).
if (action == 2 && hasAuctionSearch_) {
auctionSearch(lastAuctionSearch_.name, lastAuctionSearch_.levelMin, lastAuctionSearch_.levelMax,
lastAuctionSearch_.quality, lastAuctionSearch_.itemClass, lastAuctionSearch_.itemSubClass,
lastAuctionSearch_.invTypeMask, lastAuctionSearch_.usableOnly, lastAuctionSearch_.offset);