mirror of
https://github.com/OpenDiablo2/OpenDiablo2
synced 2025-01-13 04:46:38 -05:00
removed all 'wsl' lint errors (#836)
This commit is contained in:
parent
1ce2af19bf
commit
02acba231b
@ -64,5 +64,6 @@ func (h Hero) GetToken3() string {
|
||||
default:
|
||||
log.Fatalf("Unknown hero token: %d", h)
|
||||
}
|
||||
|
||||
return ""
|
||||
}
|
||||
|
@ -124,6 +124,7 @@ func (f *HeroStateFactory) CreateHeroSkillsState(classStats *d2records.CharStats
|
||||
|
||||
skillList := f.asset.Records.Skill.Details
|
||||
token := strings.ToLower(heroType.GetToken3())
|
||||
|
||||
for idx := range skillList {
|
||||
if skillList[idx].Charclass == token {
|
||||
skill, _ := f.CreateHeroSkill(0, skillList[idx].Skill)
|
||||
@ -145,12 +146,12 @@ func (f *HeroStateFactory) CreateHeroSkillsState(classStats *d2records.CharStats
|
||||
func (f *HeroStateFactory) CreateHeroSkill(points int, name string) (*HeroSkill, error) {
|
||||
skillRecord := f.asset.Records.GetSkillByName(name)
|
||||
if skillRecord == nil {
|
||||
return nil, fmt.Errorf("Skill not found: %s", name)
|
||||
return nil, fmt.Errorf("skill not found: %s", name)
|
||||
}
|
||||
|
||||
skillDescRecord, found := f.asset.Records.Skill.Descriptions[skillRecord.Skilldesc]
|
||||
if !found {
|
||||
return nil, fmt.Errorf("Skill Description not found: %s", name)
|
||||
return nil, fmt.Errorf("skill Description not found: %s", name)
|
||||
}
|
||||
|
||||
result := &HeroSkill{
|
||||
|
@ -385,8 +385,7 @@ func (i *Item) pickRandomAffixes(max, totalMax int,
|
||||
// SetSeed sets the item generator seed
|
||||
func (i *Item) SetSeed(seed int64) {
|
||||
if i.rand == nil {
|
||||
source := rand.NewSource(seed)
|
||||
i.rand = rand.New(source)
|
||||
i.rand = rand.New(rand.NewSource(seed))
|
||||
}
|
||||
|
||||
i.Seed = seed
|
||||
@ -441,8 +440,7 @@ func (i *Item) generateProperties(pool PropertyPool) {
|
||||
if generated := i.generateSetItemProperties(); generated != nil {
|
||||
props = generated
|
||||
}
|
||||
case PropertyPoolSet:
|
||||
// https://github.com/OpenDiablo2/OpenDiablo2/issues/817
|
||||
case PropertyPoolSet: // https://github.com/OpenDiablo2/OpenDiablo2/issues/817
|
||||
}
|
||||
|
||||
if props == nil {
|
||||
|
@ -38,6 +38,7 @@ const (
|
||||
firstTab = iota
|
||||
secondTab
|
||||
thirdTab
|
||||
numTabs
|
||||
)
|
||||
|
||||
const (
|
||||
@ -97,7 +98,7 @@ type skillTree struct {
|
||||
frame *d2ui.UIFrame
|
||||
availSPLabel *d2ui.Label
|
||||
closeButton *d2ui.Button
|
||||
tab [3]*skillTreeTab
|
||||
tab [numTabs]*skillTreeTab
|
||||
isOpen bool
|
||||
originX int
|
||||
originY int
|
||||
@ -122,7 +123,7 @@ func newSkillTree(
|
||||
guiManager: guiManager,
|
||||
originX: skillTreePanelX,
|
||||
originY: skillTreePanelY,
|
||||
tab: [3]*skillTreeTab{
|
||||
tab: [numTabs]*skillTreeTab{
|
||||
{},
|
||||
{},
|
||||
{},
|
||||
@ -176,7 +177,7 @@ func (s *skillTree) loadForHeroType() {
|
||||
type heroTabData struct {
|
||||
resources *skillTreeHeroTypeResources
|
||||
str1, str2, str3 string
|
||||
closeButtonPos [3]int
|
||||
closeButtonPos [numTabs]int
|
||||
}
|
||||
|
||||
func makeTabString(keys ...interface{}) string {
|
||||
@ -196,8 +197,8 @@ func makeTabString(keys ...interface{}) string {
|
||||
return fmt.Sprintf(format, translations...)
|
||||
}
|
||||
|
||||
func makeCloseButtonPos(close1, close2, close3 int) [3]int {
|
||||
return [3]int{close1, close2, close3}
|
||||
func makeCloseButtonPos(close1, close2, close3 int) [numTabs]int {
|
||||
return [numTabs]int{close1, close2, close3}
|
||||
}
|
||||
|
||||
func (s *skillTree) getTab(class d2enum.Hero) (heroTabData, bool) {
|
||||
@ -315,7 +316,7 @@ func (s *skillTree) setHeroTypeResourcePath() {
|
||||
s.tab[secondTab].buttonText = entry.str2
|
||||
s.tab[thirdTab].buttonText = entry.str3
|
||||
|
||||
for i := 0; i < 3; i++ {
|
||||
for i := 0; i < numTabs; i++ {
|
||||
s.tab[i].closeButtonPosX = entry.closeButtonPos[i]
|
||||
}
|
||||
}
|
||||
@ -336,9 +337,11 @@ func (s *skillTree) Close() {
|
||||
s.isOpen = false
|
||||
s.guiManager.SetLayout(nil)
|
||||
s.closeButton.SetVisible(false)
|
||||
for i := 0; i < 3; i++ {
|
||||
|
||||
for i := 0; i < numTabs; i++ {
|
||||
s.tab[i].button.SetVisible(false)
|
||||
}
|
||||
|
||||
s.onCloseCb()
|
||||
}
|
||||
|
||||
@ -350,7 +353,8 @@ func (s *skillTree) Open() {
|
||||
}
|
||||
|
||||
s.closeButton.SetVisible(true)
|
||||
for i := 0; i < 3; i++ {
|
||||
|
||||
for i := 0; i < numTabs; i++ {
|
||||
s.tab[i].button.SetVisible(true)
|
||||
}
|
||||
|
||||
|
@ -340,6 +340,7 @@ func (g *GameClient) createMissileEntities(skillRecord *d2records.SkillRecord, p
|
||||
}
|
||||
|
||||
missileEntities := make([]*d2mapentity.Missile, 0)
|
||||
|
||||
for _, missileRecord := range missileRecords {
|
||||
if missileRecord == nil {
|
||||
continue
|
||||
|
Loading…
Reference in New Issue
Block a user