From 170ff1597c4eb216506c2d5f4019cf5f3c10ad09 Mon Sep 17 00:00:00 2001 From: Kelsi Date: Wed, 11 Mar 2026 00:46:11 -0700 Subject: [PATCH] fix: prefetch item info for trade slot items in SMSG_TRADE_STATUS_EXTENDED After parsing the peer's trade window state, query item info for all occupied slots so item names display immediately rather than showing 'Item 12345' until the cache is populated on the next frame. --- src/game/game_handler.cpp | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/game/game_handler.cpp b/src/game/game_handler.cpp index af655890..47eaf0b4 100644 --- a/src/game/game_handler.cpp +++ b/src/game/game_handler.cpp @@ -19201,6 +19201,11 @@ void GameHandler::handleTradeStatusExtended(network::Packet& packet) { else peerTradeGold_ = coins; } + // Prefetch item info for all occupied trade slots so names show immediately + for (const auto& s : slots) { + if (s.occupied && s.itemId != 0) queryItemInfo(s.itemId, 0); + } + LOG_DEBUG("SMSG_TRADE_STATUS_EXTENDED: isSelf=", (int)isSelf, " myGold=", myTradeGold_, " peerGold=", peerTradeGold_); }