Skip to content

Commit

Permalink
chore: also track scoreboard assist value
Browse files Browse the repository at this point in the history
  • Loading branch information
redraskal committed Feb 23, 2024
1 parent cb0691d commit 00593f1
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 5 deletions.
10 changes: 6 additions & 4 deletions dissect/scoreboard.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,10 @@ type Scoreboard struct {
}

type ScoreboardPlayer struct {
ID []byte
Score uint32
Assists uint32
ID []byte
Score uint32
Assists uint32
AssistsFromRound uint32
}

func readScoreboardAssists(r *Reader) error {
Expand All @@ -31,7 +32,8 @@ func readScoreboardAssists(r *Reader) error {
username := "N/A"
if idx != -1 {
username = r.Header.Players[idx].Username
r.Scoreboard.Players[idx].Assists++
r.Scoreboard.Players[idx].Assists = assists
r.Scoreboard.Players[idx].AssistsFromRound++
}
log.Debug().
Uint32("assists", assists).
Expand Down
2 changes: 1 addition & 1 deletion dissect/stats.go
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ func (r *Reader) PlayerStats() []PlayerRoundStats {
Username: p.Username,
TeamIndex: p.TeamIndex,
Operator: p.Operator.String(),
Assists: int(scorePlayer.Assists),
Assists: int(scorePlayer.AssistsFromRound),
Score: int(scorePlayer.Score),
})
index[p.Username] = i
Expand Down

0 comments on commit 00593f1

Please sign in to comment.