Fix quest details parser, ImGui ID conflict, and gossip reopen guard

Quest details parser now reads all 6 choice + 4 reward item slots
(matching AzerothCore's fixed-size arrays) with bounds checking at
every step. Use loop index for quest ImGui IDs instead of questId to
avoid conflicts. Don't reopen gossip window while quest details are
showing.
This commit is contained in:
Kelsi 2026-02-06 12:08:47 -08:00
parent 67a3da3bae
commit a4a39c7f0f
3 changed files with 33 additions and 18 deletions

View file

@ -1610,8 +1610,9 @@ void GameScreen::renderGossipWindow(game::GameHandler& gameHandler) {
ImGui::Spacing();
ImGui::Separator();
ImGui::TextColored(ImVec4(1.0f, 1.0f, 0.3f, 1.0f), "Quests:");
for (const auto& quest : gossip.quests) {
ImGui::PushID(static_cast<int>(quest.questId));
for (size_t qi = 0; qi < gossip.quests.size(); qi++) {
const auto& quest = gossip.quests[qi];
ImGui::PushID(static_cast<int>(qi));
char qlabel[256];
snprintf(qlabel, sizeof(qlabel), "[%d] %s", quest.questLevel, quest.title.c_str());
ImGui::PushStyleColor(ImGuiCol_Text, ImVec4(1.0f, 1.0f, 0.3f, 1.0f));