From 1f72a802ec2d24bb36531966d16a67c1159b2594 Mon Sep 17 00:00:00 2001 From: frutescens Date: Sat, 9 Nov 2024 19:41:47 -0800 Subject: [PATCH] Thank you Torranx --- src/phases/game-over-phase.ts | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/src/phases/game-over-phase.ts b/src/phases/game-over-phase.ts index e5df1a20113..f8d904c067a 100644 --- a/src/phases/game-over-phase.ts +++ b/src/phases/game-over-phase.ts @@ -173,16 +173,18 @@ export class GameOverPhase extends BattlePhase { }); }; - /* Added a local check to see if the game is running offline on victory + /* Added a local check to see if the game is running offline If Online, execute apiFetch as intended - If Offline, execute offlineNewClear(), a localStorage implementation of newClear daily run checks */ + If Offline, execute offlineNewClear() only for victory, a localStorage implementation of newClear daily run checks */ if (!Utils.isLocal || Utils.isLocalServerConnected) { pokerogueApi.savedata.session.newclear({ slot: this.scene.sessionSlotId, isVictory: this.isVictory, clientSessionId: clientSessionId }) .then((success) => doGameOver(!!success)); } else { - this.scene.gameData.offlineNewClear(this.scene).then(result => { - doGameOver(result); - }); + if (this.isVictory) { + this.scene.gameData.offlineNewClear(this.scene).then(result => { + doGameOver(result); + }); + } } }