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.
This commit is contained in:
Kelsi 2026-02-17 18:55:02 -08:00
parent c998c945bf
commit 4ba10e772b

View file

@ -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<int>(vendor.items.size()); ++vi) {
const auto& item = vendor.items[vi];
ImGui::TableNextRow();
ImGui::PushID(static_cast<int>(item.slot));
ImGui::PushID(vi);
ImGui::TableSetColumnIndex(0);
auto* info = gameHandler.getItemInfo(item.itemId);