diff --git a/packages/tosu/src/entities/ResultsScreenData/index.ts b/packages/tosu/src/entities/ResultsScreenData/index.ts index 70166771..57339675 100644 --- a/packages/tosu/src/entities/ResultsScreenData/index.ts +++ b/packages/tosu/src/entities/ResultsScreenData/index.ts @@ -3,11 +3,7 @@ import rosu from 'rosu-pp-js'; import { AbstractEntity } from '@/entities/AbstractEntity'; import { OsuInstance } from '@/objects/instanceManager/osuInstance'; -import { - calculateAccuracy, - calculateGrade, - calculatePassedObjects -} from '@/utils/calculators'; +import { calculateAccuracy, calculateGrade } from '@/utils/calculators'; import { netDateBinaryToDate } from '@/utils/converters'; import { OsuMods } from '@/utils/osuMods.types'; @@ -159,29 +155,21 @@ export class ResultsScreenData extends AbstractEntity { return; } - const scoreParams = { - passedObjects: calculatePassedObjects( - this.Mode, - this.Hit300, - this.Hit100, - this.Hit50, - this.HitMiss, - this.HitKatu, - this.HitGeki - ), + const scoreParams: rosu.PerformanceArgs = { combo: this.MaxCombo, mods: this.Mods, - nMisses: this.HitMiss, + misses: this.HitMiss, n50: this.Hit50, n100: this.Hit100, - n300: this.Hit300 + n300: this.Hit300, + nKatu: this.HitKatu, + nGeki: this.HitGeki }; const curPerformance = new rosu.Performance(scoreParams).calculate( currentBeatmap ); const fcPerformance = new rosu.Performance({ - combo: curPerformance.difficulty.maxCombo, mods: this.Mods, misses: 0, accuracy: this.Accuracy diff --git a/packages/tosu/src/objects/instanceManager/osuInstance.ts b/packages/tosu/src/objects/instanceManager/osuInstance.ts index c924f511..cfbca8a7 100644 --- a/packages/tosu/src/objects/instanceManager/osuInstance.ts +++ b/packages/tosu/src/objects/instanceManager/osuInstance.ts @@ -400,7 +400,8 @@ export class OsuInstance { 'menuData', 'allTimesData', 'gamePlayData', - 'beatmapPpData' + 'beatmapPpData', + 'resultsScreenData' ]); this.updateMapMetadata(entities); @@ -411,12 +412,21 @@ export class OsuInstance { allTimesData: AllTimesData; gamePlayData: GamePlayData; beatmapPpData: BeatmapPPData; + resultsScreenData: ResultsScreenData; }) { - const { menuData, allTimesData, gamePlayData, beatmapPpData } = entries; + const { + menuData, + allTimesData, + gamePlayData, + beatmapPpData, + resultsScreenData + } = entries; const currentMods = - allTimesData.Status === 2 || allTimesData.Status === 7 + allTimesData.Status === 2 ? gamePlayData.Mods - : allTimesData.MenuMods; + : allTimesData.Status === 7 + ? resultsScreenData.Mods + : allTimesData.MenuMods; const currentState = `${menuData.MD5}:${menuData.MenuGameMode}:${currentMods}:${menuData.MP3Length}`;