Skip to content

Commit

Permalink
fixup rename acc
Browse files Browse the repository at this point in the history
  • Loading branch information
arily committed Dec 30, 2023
1 parent deace69 commit 840a1a7
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
6 changes: 3 additions & 3 deletions src/server/backend/bancho.py/transforms/create-hit-count.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,12 @@ import type { ManiaHitCount, StandardHitCount } from '~/def/score'

export function createHitCount<M extends ActiveMode>(
mode: M,
score: DBScore,
score: Pick<DBScore, 'n100' | 'n300' | 'n50' | 'nGeki' | 'nKatu' | 'nMiss'>,
) {
return (mode === Mode.Mania ? hitCountMania(score) : hitCount(score)) as M extends Mode.Mania ? ManiaHitCount : StandardHitCount
}

function hitCountMania(score: DBScore): ManiaHitCount {
function hitCountMania(score: Pick<DBScore, 'n100' | 'n300' | 'n50' | 'nGeki' | 'nKatu' | 'nMiss'>): ManiaHitCount {
return {
max: score.nGeki,
300: score.n300,
Expand All @@ -21,7 +21,7 @@ function hitCountMania(score: DBScore): ManiaHitCount {
}
}

function hitCount(score: DBScore): StandardHitCount {
function hitCount(score: Pick<DBScore, 'n100' | 'n300' | 'n50' | 'nGeki' | 'nKatu' | 'nMiss'>): StandardHitCount {
return {
300: score.n300,
geki: score.nGeki,
Expand Down
2 changes: 1 addition & 1 deletion src/server/backend/bancho.py/transforms/score.ts
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ export function toScore<M extends ActiveMode, RS extends PPRankingSystem>({
// mods: score.mods,
score: BigInt(score.score),
grade: (score.grade === 'N' ? 'F' : score.grade) as Grade,
accuracy: score.acc,
accuracy: score.accuracy,
hit: createHitCount(mode, score),
beatmap: (score.beatmap !== null
&& toBeatmapWithBeatmapset(score.beatmap)) || {
Expand Down

0 comments on commit 840a1a7

Please sign in to comment.