fix: query item info in SMSG_LOOT_START_ROLL and use live name in roll popup

SMSG_LOOT_START_ROLL was not calling queryItemInfo(), so the roll popup
would display item IDs instead of names when the item had not been
previously cached (e.g. first time seeing that item in the session).

Also update renderLootRollPopup to prefer the live ItemQueryResponseData
name/quality over the snapshot captured at parse time, so the popup
shows the correct name once SMSG_ITEM_QUERY_SINGLE_RESPONSE arrives.
This commit is contained in:
Kelsi 2026-03-13 05:23:31 -07:00
parent 48bcee32b4
commit 103bb5a513
2 changed files with 12 additions and 1 deletions

View file

@ -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);
}