diff --git a/src/game/game_handler.cpp b/src/game/game_handler.cpp index 3d46fd31..ac884141 100644 --- a/src/game/game_handler.cpp +++ b/src/game/game_handler.cpp @@ -2084,6 +2084,10 @@ void GameHandler::handlePacket(network::Packet& packet) { pendingLootRoll_.objectGuid = objectGuid; pendingLootRoll_.slot = slot; pendingLootRoll_.itemId = itemId; + // Ensure item info is queried so the roll popup can show the name/icon. + // The popup re-reads getItemInfo() live, so the name will populate once + // SMSG_ITEM_QUERY_SINGLE_RESPONSE arrives (usually within ~100 ms). + queryItemInfo(itemId, 0); auto* info = getItemInfo(itemId); pendingLootRoll_.itemName = info ? info->name : std::to_string(itemId); pendingLootRoll_.itemQuality = info ? static_cast(info->quality) : 0; diff --git a/src/ui/game_screen.cpp b/src/ui/game_screen.cpp index 92dccefe..dd81e8eb 100644 --- a/src/ui/game_screen.cpp +++ b/src/ui/game_screen.cpp @@ -10716,7 +10716,14 @@ void GameScreen::renderLootRollPopup(game::GameHandler& gameHandler) { ImGui::Image((ImTextureID)(uintptr_t)rollIcon, ImVec2(24, 24)); ImGui::SameLine(); } - ImGui::TextColored(col, "[%s]", roll.itemName.c_str()); + // Prefer live item info (arrives via SMSG_ITEM_QUERY_SINGLE_RESPONSE after the + // roll popup opens); fall back to the name cached at SMSG_LOOT_START_ROLL time. + const char* displayName = (rollInfo && rollInfo->valid && !rollInfo->name.empty()) + ? rollInfo->name.c_str() + : roll.itemName.c_str(); + if (rollInfo && rollInfo->valid) + col = (rollInfo->quality < 6) ? kQualityColors[rollInfo->quality] : kQualityColors[1]; + ImGui::TextColored(col, "[%s]", displayName); if (ImGui::IsItemHovered() && rollInfo && rollInfo->valid) { inventoryScreen.renderItemTooltip(*rollInfo); }