From 9317b70a3a4b847324f818791302f030c9e02090 Mon Sep 17 00:00:00 2001 From: Kelsi Date: Tue, 17 Feb 2026 18:55:02 -0800 Subject: [PATCH] Fix vendor window ImGui ID conflicts using loop index PushID(item.slot) causes conflicting IDs when the server sends items with duplicate or zero slot values. Use the loop index instead, which is always unique regardless of what the server puts in the slot field. --- src/ui/game_screen.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/ui/game_screen.cpp b/src/ui/game_screen.cpp index 56f07596..ab843c76 100644 --- a/src/ui/game_screen.cpp +++ b/src/ui/game_screen.cpp @@ -4787,9 +4787,10 @@ void GameScreen::renderVendorWindow(game::GameHandler& gameHandler) { ImVec4(1.0f, 0.5f, 0.0f, 1.0f), // 5 Legendary (orange) }; - for (const auto& item : vendor.items) { + for (int vi = 0; vi < static_cast(vendor.items.size()); ++vi) { + const auto& item = vendor.items[vi]; ImGui::TableNextRow(); - ImGui::PushID(static_cast(item.slot)); + ImGui::PushID(vi); ImGui::TableSetColumnIndex(0); auto* info = gameHandler.getItemInfo(item.itemId);