mirror of
https://github.com/Kelsidavis/WoWee.git
synced 2026-05-03 08:03:50 +00:00
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:
parent
2ae98fcc00
commit
9317b70a3a
1 changed files with 3 additions and 2 deletions
|
|
@ -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);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue