Skip to content

Commit

Permalink
Correctly calculate scores for 170
Browse files Browse the repository at this point in the history
  • Loading branch information
thordy committed Nov 13, 2024
1 parent c62967b commit 0242f51
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions data/leg.go
Original file line number Diff line number Diff line change
Expand Up @@ -1204,13 +1204,16 @@ func GetLeg(id int) (*models.Leg, error) {
scores[visit.PlayerID].CurrentScore += score
}
} else if matchType == models.ONESEVENTY {
player := scores[visit.PlayerID]
score = visit.Calculate170Score(round, player)
// This is done below regardless of if the visit was a bust
} else {
scores[visit.PlayerID].CurrentScore -= score
}
visit.Score = score
}
if matchType == models.ONESEVENTY {
player := scores[visit.PlayerID]
visit.Score = visit.Calculate170Score(round, player)
}

visit.Scores = make(map[int]int)
visit.Scores[visit.PlayerID] = scores[visit.PlayerID].CurrentScore
Expand Down

0 comments on commit 0242f51

Please sign in to comment.