From 4aff2ffa1d4bfe82494b3489f21e46b6a88adc6a Mon Sep 17 00:00:00 2001 From: Mumble <171087428+frutescens@users.noreply.github.com> Date: Sat, 16 Nov 2024 15:30:47 -0800 Subject: [PATCH] [Dev] Sessions will now sync with the server at the start of every 5 waves (#4808) * Replaced conditional with `true` so that sync-to-server occurs at the start of every wave. * Update src/phases/encounter-phase.ts Co-authored-by: Frederico Santos * Fixed errors from previous commit. * Revised condition to include the first wave of a run. * Apply suggestions from code review Co-authored-by: Moka <54149968+MokaStitcher@users.noreply.github.com> --------- Co-authored-by: frutescens Co-authored-by: Frederico Santos Co-authored-by: Moka <54149968+MokaStitcher@users.noreply.github.com> --- src/phases/encounter-phase.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/phases/encounter-phase.ts b/src/phases/encounter-phase.ts index fc022ab9647..e58500c934e 100644 --- a/src/phases/encounter-phase.ts +++ b/src/phases/encounter-phase.ts @@ -225,7 +225,8 @@ export class EncounterPhase extends BattlePhase { this.scene.ui.setMode(Mode.MESSAGE).then(() => { if (!this.loaded) { this.trySetWeatherIfNewBiome(); // Set weather before session gets saved - this.scene.gameData.saveAll(this.scene, true, battle.waveIndex % 10 === 1 || (this.scene.lastSavePlayTime ?? 0) >= 300).then(success => { + // Game syncs to server on waves X1 and X6 (As of 1.2.0) + this.scene.gameData.saveAll(this.scene, true, battle.waveIndex % 5 === 1 || (this.scene.lastSavePlayTime ?? 0) >= 300).then(success => { this.scene.disableMenu = false; if (!success) { return this.scene.reset(true);