Skip to content

fix: name-based talent matching for TBC Anniversary index reordering#19

Merged
Xerrion merged 1 commit intomasterfrom
fix/issue-12-talent-index-mismatch
Mar 1, 2026
Merged

fix: name-based talent matching for TBC Anniversary index reordering#19
Xerrion merged 1 commit intomasterfrom
fix/issue-12-talent-index-mismatch

Conversation

@Xerrion
Copy link
Collaborator

@Xerrion Xerrion commented Mar 1, 2026

Summary

Fixes #12 - Talents reading incorrectly on TBC Anniversary.

Root Cause

The TBC Anniversary client (1.15.x unified Classic client) orders talents by internal talentID rather than the row/column grid position used by the old TBC Classic client. 15 of 18 Warlock TalentMap keys pointed to the wrong talent, causing rank misattribution (e.g. "Improved Life Tap 5/2") and wildly inflated calculations.

Changes

  • Name-based talent matching in StateCollector.CollectTalents - matches talents by the name returned from GetTalentInfo against TalentMap entries instead of relying on positional indices. Immune to talent index reordering across client versions.
  • Defensive maxRank clamping - talent rank is clamped to the declared maximum as defense-in-depth.
  • Fixed Warlock TalentMap indices - all keys updated to match verified in-game TBC Anniversary ordering.
  • Grid layout documentation added to TalentMap_Warlock.lua following the Rogue file pattern.
  • 8 new unit tests for the name-based matching logic (name matching, maxRank clamping, untracked talents, zero-rank skip, class prefix filtering, missing maxRank, empty tree).
  • Updated existing Warlock tests with corrected talent keys.

Files Changed

File Change
Core/StateCollector.lua Rewrote CollectTalents with name-based matching + maxRank clamping
Data/TalentMap_Warlock.lua Fixed 15 wrong indices + added grid layout docs
tests/test_new_talents.lua Updated 26 talent key references
tests/test_warlock_completion.lua Updated 5 talent key references
tests/test_statecollector_talents.lua New - 8 unit tests for name-based matching

Scope Note

The name-based matching fix resolves this for all classes automatically. Other class TalentMap index corrections (documentation cleanup) can be done in follow-up PRs without impacting users.

…12)

The TBC Anniversary client orders talents by internal talentID rather
than row/column grid position. This caused 15 of 18 Warlock TalentMap
keys to point to wrong talents, producing incorrect rank readings
(e.g. "Improved Life Tap 5/2") and wildly inflated calculations.

- Rewrite StateCollector.CollectTalents to match talents by name
  instead of positional index, making it immune to reordering
- Add defensive maxRank clamping in StateCollector
- Fix all Warlock TalentMap indices to match in-game verified data
- Add grid layout documentation to TalentMap_Warlock.lua
- Add 8 unit tests for name-based matching logic
- Update existing Warlock test files with corrected keys

Fixes #12
@Xerrion Xerrion merged commit 34ecc84 into master Mar 1, 2026
1 of 2 checks passed
@Xerrion Xerrion deleted the fix/issue-12-talent-index-mismatch branch March 1, 2026 19:43
Xerrion added a commit that referenced this pull request Mar 1, 2026
Updated test files (test_modifiercalc, test_critcalc, test_new_spells,
test_pipeline) to use reindexed Warlock TalentMap keys from PR #19.

Fixed Master Demonologist talentAmplify.talentKey in AuraMap_Warlock
from 2:16 (Soul Link) to 2:11 (Master Demonologist).
Xerrion added a commit that referenced this pull request Mar 1, 2026
* fix: correct TalentMap indices for all classes (#21)

Verified all TalentMap talent positions (tab:index) against in-game
GetTalentInfo output on TBC Anniversary client (1.15.x).

Classes corrected (key changes):
- Priest: 7 of 8 entries
- Warrior: 10 of 11 entries + deferred comments
- Rogue: 15 of 17 entries + deferred comments
- Paladin: 8 of 9 entries

Classes verified correct (docs only):
- Mage: all 21 entries already correct
- Druid: all 19 entries already correct
- Shaman: all 12 entries already correct

All files now include grid layout documentation showing the full
talent tree ordered by internal talentID, matching the in-game API.

Also fixed .busted config pattern from '_spec' to 'test_' to match
actual test file naming convention.

* fix: correct stale talent keys in Warlock tests and AuraMap (#21)

Updated test files (test_modifiercalc, test_critcalc, test_new_spells,
test_pipeline) to use reindexed Warlock TalentMap keys from PR #19.

Fixed Master Demonologist talentAmplify.talentKey in AuraMap_Warlock
from 2:16 (Soul Link) to 2:11 (Master Demonologist).

* feat: beautify tooltip with school colors and spell identity (#21)

- Extract shared Format module (colors, symbols, FormatNumber, FormatDPS)
- Add spell name and rank header line with school-colored text
- Restore labeled detail lines (Coeff, Cast, Talents, Stats, Breakdown)
- Hide 0% crit for DoT-only spells
- Use directCoefficient/dotCoefficient for safe hybrid display
- Replace non-rendering Unicode escapes with ASCII alternatives
- Deduplicate FormatNumber between Tooltip and ActionBar
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.

Talents reading incorrectly

1 participant