mirror of
https://github.com/OpenDiablo2/OpenDiablo2
synced 2024-12-25 19:46:50 -05:00
parent
88326b5278
commit
7fb57a273b
@ -8,6 +8,12 @@ import "github.com/OpenDiablo2/OpenDiablo2/d2core/d2asset"
|
||||
func HydrateSkills(skills map[int]*HeroSkill, asset *d2asset.AssetManager) {
|
||||
for skillID := range skills {
|
||||
heroSkill := skills[skillID]
|
||||
|
||||
// TODO: figure out why these are nil sometimes
|
||||
if heroSkill == nil {
|
||||
continue
|
||||
}
|
||||
|
||||
heroSkill.SkillRecord = asset.Records.Skill.Details[skillID]
|
||||
heroSkill.SkillDescriptionRecord = asset.Records.Skill.Descriptions[heroSkill.SkillRecord.Skilldesc]
|
||||
heroSkill.SkillPoints = skills[skillID].SkillPoints
|
||||
|
@ -187,6 +187,12 @@ func (f *HeroStateFactory) LoadHeroState(filePath string) *HeroState {
|
||||
// We cant do this while unmarshalling because there is no reference to the asset manager.
|
||||
for idx := range result.Skills {
|
||||
hs := result.Skills[idx]
|
||||
|
||||
// TODO: figure out why this can be nil
|
||||
if hs == nil {
|
||||
continue
|
||||
}
|
||||
|
||||
hs.SkillRecord = f.asset.Records.Skill.Details[hs.shallow.SkillID]
|
||||
hs.SkillDescriptionRecord = f.asset.Records.Skill.Descriptions[hs.SkillRecord.Skilldesc]
|
||||
hs.SkillPoints = hs.shallow.SkillPoints
|
||||
|
Loading…
Reference in New Issue
Block a user