Skip to content

Commit

Permalink
fix: hand face score comparison.
Browse files Browse the repository at this point in the history
  • Loading branch information
ainilili committed Apr 12, 2024
1 parent 6d8d853 commit b8e3885
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion state/game/texas/round.go
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,9 @@ func settlementRound(game *database.Texas) error {
return err
}
buf.WriteString(fmt.Sprintf("%s: %s, type: %s, score: %d\n", player.Name, player.Hand.TexasString(), faces.Type, faces.Score))
if maxFaces == nil || (maxFaces.Type < faces.Type || maxFaces.Score < faces.Score) {
if maxFaces == nil ||
maxFaces.Type < faces.Type ||
(maxFaces.Type == faces.Type && maxFaces.Score < faces.Score) {
maxFaces = faces
maxPlayers = []int64{player.ID}
continue
Expand Down

0 comments on commit b8e3885

Please sign in to comment.