From a9a4e0c09fa7afe975457070971e71d81b76f518 Mon Sep 17 00:00:00 2001 From: ck <21735205+cyperdark@users.noreply.github.com> Date: Sun, 30 Jun 2024 22:53:19 +0300 Subject: [PATCH] chore: fix gameplay data resets --- .../tosu/src/entities/TourneyUserProfileData/index.ts | 2 +- packages/tosu/src/objects/instanceManager/osuInstance.ts | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/packages/tosu/src/entities/TourneyUserProfileData/index.ts b/packages/tosu/src/entities/TourneyUserProfileData/index.ts index db33720e..064334ed 100644 --- a/packages/tosu/src/entities/TourneyUserProfileData/index.ts +++ b/packages/tosu/src/entities/TourneyUserProfileData/index.ts @@ -47,7 +47,7 @@ export class TourneyUserProfileData extends AbstractEntity { wLogger.debug('TUPD(updateState) Slot is not equiped'); this.resetState(); - gamePlayData.init(); + gamePlayData.init(undefined, 'tourney'); return; } diff --git a/packages/tosu/src/objects/instanceManager/osuInstance.ts b/packages/tosu/src/objects/instanceManager/osuInstance.ts index cfbca8a7..4b8effbb 100644 --- a/packages/tosu/src/objects/instanceManager/osuInstance.ts +++ b/packages/tosu/src/objects/instanceManager/osuInstance.ts @@ -295,7 +295,7 @@ export class OsuInstance { case 5: // Reset Gameplay/ResultScreen data on joining to songSelect if (!gamePlayData.isDefaultState) { - gamePlayData.init(); + gamePlayData.init(undefined, '4,5'); resultsScreenData.init(); beatmapPpData.resetCurrentAttributes(); } @@ -316,8 +316,8 @@ export class OsuInstance { this.previousTime = allTimesData.PlayTime; if ( - allTimesData.PlayTime < 0 && - !gamePlayData.isDefaultState + allTimesData.PlayTime < + Math.min(50, beatmapPpData.timings.firstObj) ) { gamePlayData.init(true, 'not-default'); break; @@ -338,7 +338,7 @@ export class OsuInstance { break; default: - gamePlayData.init(); + gamePlayData.init(undefined, 'default'); resultsScreenData.init(); break; }