horsegen: treat inherited skills as being in the original's group
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user