horsegen: treat inherited skills as being in the original's group

This commit is contained in:
2026-01-16 23:30:14 -05:00
parent cb1c51db05
commit a86aa0daeb
3 changed files with 64 additions and 74 deletions

View File

@@ -74,19 +74,8 @@ func ExecCharacter(t *template.Template, region string, kk, g io.Writer, c []Nam
func ExecSkill(t *template.Template, region string, kk, g io.Writer, groups []NamedID[SkillGroup], skills []Skill) error {
m := make(map[int][]Skill, len(groups))
u := make(map[int]int, len(groups))
for _, t := range skills {
m[t.GroupID] = append(m[t.GroupID], t)
if t.Rarity >= 4 {
// Add inheritable uniques to u so we can add inherited versions to groups.
u[t.ID] = t.GroupID
}
}
// Now that u is set up, iterate through again and add in inherited skills.
for _, t := range skills {
if t.InheritID != 0 {
m[u[t.InheritID]] = append(m[u[t.InheritID]], t)
}
}
data := struct {
Region string