Skip to content

Commit

Permalink
style: fix code style issues with gofmt
Browse files Browse the repository at this point in the history
  • Loading branch information
lint-action committed Sep 10, 2024
1 parent ed7653e commit f44e57b
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 21 deletions.
16 changes: 8 additions & 8 deletions src/char.go
Original file line number Diff line number Diff line change
Expand Up @@ -1787,16 +1787,16 @@ func (p *Projectile) tradeDetection(playerNo, index int) {
continue
}

// If at parent's index, skip self and previously checked pairs
// If at parent's index, skip self and previously checked pairs
// In Mugen, projectiles just never hit other projectiles from the same player
startj := 0
if i == playerNo {
startj = index + 1
}
startj := 0
if i == playerNo {
startj = index + 1
}

// Loop through their projectiles
for j := startj; j < len(sys.projs[i]); j++ {
pr := &sys.projs[i][j]
for j := startj; j < len(sys.projs[i]); j++ {
pr := &sys.projs[i][j]

// Skip if other projectile can't trade
if pr.remflag || pr.hits < 0 || pr.id < 0 {
Expand All @@ -1812,7 +1812,7 @@ func (p *Projectile) tradeDetection(playerNo, index int) {
if p.hitdef.affectteam != 0 && pr.hitdef.affectteam != 0 {
friendly := p.hitdef.teamside == pr.hitdef.teamside
if (p.hitdef.affectteam > 0 && pr.hitdef.affectteam > 0 && friendly) ||
(p.hitdef.affectteam < 0 && pr.hitdef.affectteam < 0 && !friendly) {
(p.hitdef.affectteam < 0 && pr.hitdef.affectteam < 0 && !friendly) {
continue
}
}
Expand Down
10 changes: 5 additions & 5 deletions src/lifebar.go
Original file line number Diff line number Diff line change
Expand Up @@ -2104,7 +2104,7 @@ func (ro *LifeBarRound) isSingleRound() bool {

func (ro *LifeBarRound) isFinalRound() bool {
return !sys.consecutiveRounds && sys.round > 1 && sys.roundType[0] == RT_Final &&
(sys.draws >= sys.lifebar.ro.match_maxdrawgames[0] || sys.draws >= sys.lifebar.ro.match_maxdrawgames[1])
(sys.draws >= sys.lifebar.ro.match_maxdrawgames[0] || sys.draws >= sys.lifebar.ro.match_maxdrawgames[1])
}

func (ro *LifeBarRound) act() bool {
Expand Down Expand Up @@ -2440,9 +2440,9 @@ func (ro *LifeBarRound) draw(layerno int16, f []*Fnt) {
// Draw default round background
for i := range ro.round_default_bg {
ro.round_default_bg[i].Draw(
float32(ro.pos[0])+sys.lifebarOffsetX,
float32(ro.pos[1]),
layerno,
float32(ro.pos[0])+sys.lifebarOffsetX,
float32(ro.pos[1]),
layerno,
sys.lifebarScale,
)
}
Expand Down Expand Up @@ -2492,7 +2492,7 @@ func (ro *LifeBarRound) draw(layerno int16, f []*Fnt) {

// Backup round_ref text
tmp = round_ref.text.text

// Format the round_ref text with the round number
round_ref.text.text = OldSprintf(tmp, roundNum)

Expand Down
16 changes: 8 additions & 8 deletions src/system.go
Original file line number Diff line number Diff line change
Expand Up @@ -857,10 +857,10 @@ func (s *System) clsnOverlap(clsn1 []float32, scl1, pos1 [2]float32, facing1 flo
if facing1 < 0 {
l1, r1 = -r1, -l1
}
left1 := l1*scl1[0]+pos1[0]
right1 := r1*scl1[0]+pos1[0]
top1 := clsn1[i+1]*scl1[1]+pos1[1]
bottom1 := clsn1[i+3]*scl1[1]+pos1[1]
left1 := l1*scl1[0] + pos1[0]
right1 := r1*scl1[0] + pos1[0]
top1 := clsn1[i+1]*scl1[1] + pos1[1]
bottom1 := clsn1[i+3]*scl1[1] + pos1[1]

// Loop through second set of boxes
for j := 0; j+3 < len(clsn2); j += 4 {
Expand All @@ -870,10 +870,10 @@ func (s *System) clsnOverlap(clsn1 []float32, scl1, pos1 [2]float32, facing1 flo
if facing2 < 0 {
l2, r2 = -r2, -l2
}
left2 := l2*scl2[0]+pos2[0]
right2 := r2*scl2[0]+pos2[0]
top2 := clsn2[j+1]*scl2[1]+pos2[1]
bottom2 := clsn2[j+3]*scl2[1]+pos2[1]
left2 := l2*scl2[0] + pos2[0]
right2 := r2*scl2[0] + pos2[0]
top2 := clsn2[j+1]*scl2[1] + pos2[1]
bottom2 := clsn2[j+3]*scl2[1] + pos2[1]

// Check for overlap
if left1 <= right2 && left2 <= right1 && top1 <= bottom2 && top2 <= bottom1 {
Expand Down

0 comments on commit f44e57b

Please sign in to comment.