Skip to content

Fix zone auto-complete bug during guide load#3308

Draft
Hendo72 wants to merge 2 commits intoLudovicus-Maior:mainfrom
Hendo72:Guide-window-active-step-display-issue
Draft

Fix zone auto-complete bug during guide load#3308
Hendo72 wants to merge 2 commits intoLudovicus-Maior:mainfrom
Hendo72:Guide-window-active-step-display-issue

Conversation

@Hendo72
Copy link
Copy Markdown
Contributor

@Hendo72 Hendo72 commented Apr 6, 2026

What the bug is

  • During guide load, a zone-based step can be auto-completed by AutoCompleteZone()
  • But the guide was not fully refreshed afterward
  • That left the step marked complete in data, while the active guide UI still showed it as the current active step

In short: AutoCompleteZone() completed a F/H/b/P/R step during setup, but the guide load process did not re-synchronize the guide state and the completed step would still appear active in the guide window.

TL;DR

  • Fix targets the load-time edge case where zone auto-completion and guide refresh were out of sync.
  • It makes AutoCompleteZone() settle during setup, then refreshes once if needed.
  • It also adds safety fallback for pathological cases and avoids extra updates on normal zone changes.

What changed in WoWPro_Parser.lua

Added a bounded retry loop around WoWPro.AutoCompleteZone() inside SetupGuideReal().

  • The code now:
    1. sets WoWPro.GuideLoaded = "Loaded"
    2. runs WoWPro:AutoCompleteQuestUpdate(nil) and initial WoWPro:UpdateGuide("WoWPro.SetupGuideReal(1)")
      repeatedly calls WoWPro.AutoCompleteZone() while it keeps completing steps
    3. stops when no more zone auto-completions occur
  • Safety controls were added (as per Furydin's suggestion):
    • maxZoneAttempts limit
    • maxZoneTime timeout
    • If those limits are exceeded, the code now aborts the loop and reloads the guide cleanly instead of continuing indefinitely.

What changed in WoWPro_Events.lua

  • The ZONE_CHANGED event handler was tightened so WoWPro:UpdateGuide(event) only runs when WoWPro.AutoCompleteZone() actually returns true.
  • That means the guide is refreshed only when a zone-based step was completed, not on every zone change.

Why this fixes it

  • The parser change makes sure load-time zone auto-completions are detected and the guide is refreshed after they happen.
  • The event change avoids unnecessary updates and keeps ZONE_CHANGED behavior aligned with actual state change.
  • The loop is bounded so addon initialization cannot hang or risk Blizzard killing the addon because of excessive load-time work.

** each file change was done in its own commit for clarity.

Hendo72 added 2 commits April 6, 2026 12:17
- changed the ZONE_CHANGED handler so  WoWPro:UpdateGuide(event) is only called when WoWPro.AutoCompleteZone() returns true.
- This avoids unnecessary guide refreshes on zone changes when no zone-based step auto-completion occurred.
- Keeps event handling more efficient and limits updates to actual state changes.
Bug:
- Zone-based step completion during guide load leaves stale active guide state

Fix load-time zone auto-complete so guide refreshes after zone-based completion, with bounded retry and fallback reload if needed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant