Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 16 additions & 0 deletions AGENTS.md
Original file line number Diff line number Diff line change
Expand Up @@ -198,3 +198,19 @@ PhDamage uses the **DragonAddons** org-level GitHub project board (#2) for issue
3. **Start** - Move to *In progress*, create a feature branch, add a comment.
4. **Review** - Open PR, move to *In review*, link the issue.
5. **Ship** - Squash-merge, auto-move to *Done* on close.

---

## Communication Style

When responding to or commenting on issues, always write in **first-person singular** ("I")
as the repo owner -- never use "we" or "our team". Speak as if you are the developer personally.

**Writing style:**
- Direct, structured, solution-driven. Get to the point fast. Text is a tool, not decoration.
- Think in systems. Break things into flows, roles, rules, and frameworks.
- Bias toward precision. Concrete output, copy-paste-ready solutions, clear constraints. Low
tolerance for fluff.
- Tone is calm and rational with small flashes of humor and self-awareness.
- When confident in a topic, become more informal and creative.
- When something matters, become sharp and focused.
27 changes: 25 additions & 2 deletions Core/StateCollector.lua
Original file line number Diff line number Diff line change
Expand Up @@ -344,14 +344,37 @@ function StateCollector.CollectPlayerState()
end

function StateCollector.CollectTalents(state)
-- Build reverse lookup from talent name -> TalentMap key for this class.
-- This makes talent collection immune to index reordering across client
-- versions (e.g. TBC Anniversary orders by internal talentID, not grid position).
local nameToKey = {}
local classPrefix = (state.class or "UNKNOWN") .. ":"
for mapKey, entry in pairs(ns.TalentMap) do
if mapKey:sub(1, #classPrefix) == classPrefix then
local talentKey = mapKey:sub(#classPrefix + 1)
nameToKey[entry.name] = talentKey
end
end

local numTabs = GetNumTalentTabs and GetNumTalentTabs() or 0
for tab = 1, numTabs do
local numTalents = GetNumTalents and GetNumTalents(tab) or 0
for index = 1, numTalents do
local ok, name, _, _, _, rank = pcall(GetTalentInfo, tab, index)
if ok and name and rank and rank > 0 then
local key = tab .. ":" .. index
state.talents[key] = rank
local mappedKey = nameToKey[name]
if mappedKey then
-- Clamp rank to maxRank as defense-in-depth
local entry = ns.TalentMap[classPrefix .. mappedKey]
if entry and entry.maxRank and rank > entry.maxRank then
rank = entry.maxRank
end
state.talents[mappedKey] = rank
else
-- Untracked talent: store with raw key for diagnostics visibility
local rawKey = tab .. ":" .. index
state.talents[rawKey] = rank
end
end
end
end
Expand Down
Loading
Loading