Skip to content

Commit

Permalink
fix: reset pp values after joining songSelect
Browse files Browse the repository at this point in the history
  • Loading branch information
KotRikD committed Dec 20, 2023
1 parent 78033e9 commit 7e11723
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 0 deletions.
9 changes: 9 additions & 0 deletions packages/tosu/src/entities/BeatmapPpData/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -152,6 +152,15 @@ export class BeatmapPPData extends AbstractEntity {
};
}

resetCurrentAttributes() {
this.currAttributes = {
stars: 0.0,
pp: 0.0,
maxThisPlayPP: 0.0,
fcPP: 0.0
};
}

async updateMapMetadata(currentMods: number) {
wLogger.debug(`[BeatmapPpData:updateMapMetadata] starting`);

Expand Down
3 changes: 3 additions & 0 deletions packages/tosu/src/objects/instanceManager/osuInstance.ts
Original file line number Diff line number Diff line change
Expand Up @@ -150,6 +150,7 @@ export class OsuInstance {
allTimesData,
menuData,
bassDensityData,
beatmapPpData,
gamePlayData,
resultsScreenData,
settings,
Expand All @@ -159,6 +160,7 @@ export class OsuInstance {
'allTimesData',
'menuData',
'bassDensityData',
'beatmapPpData',
'gamePlayData',
'resultsScreenData',
'settings',
Expand Down Expand Up @@ -203,6 +205,7 @@ export class OsuInstance {
if (!gamePlayData.isDefaultState) {
gamePlayData.init();
resultsScreenData.init();
beatmapPpData.resetCurrentAttributes();
}
break;
case 2:
Expand Down

0 comments on commit 7e11723

Please sign in to comment.