From aa8c355cbed0a131faff899b57c2270c9aad0c59 Mon Sep 17 00:00:00 2001 From: Sainan <63328889+Sainan@users.noreply.github.com> Date: Sat, 3 May 2025 10:19:00 +0200 Subject: [PATCH] fix: omit nightwave challenges for versions before 38.0.8 --- src/services/worldStateService.ts | 21 ++++++++++++--------- 1 file changed, 12 insertions(+), 9 deletions(-) diff --git a/src/services/worldStateService.ts b/src/services/worldStateService.ts index 0ef63d74..e444c012 100644 --- a/src/services/worldStateService.ts +++ b/src/services/worldStateService.ts @@ -763,15 +763,18 @@ export const getWorldState = (buildLabel?: string): IWorldState => { } // Nightwave Challenges - worldState.SeasonInfo.ActiveChallenges.push(getSeasonDailyChallenge(day - 2)); - worldState.SeasonInfo.ActiveChallenges.push(getSeasonDailyChallenge(day - 1)); - worldState.SeasonInfo.ActiveChallenges.push(getSeasonDailyChallenge(day - 0)); - if (isBeforeNextExpectedWorldStateRefresh(EPOCH + (day + 1) * 86400000)) { - worldState.SeasonInfo.ActiveChallenges.push(getSeasonDailyChallenge(day + 1)); - } - pushWeeklyActs(worldState, week); - if (isBeforeNextExpectedWorldStateRefresh(weekEnd)) { - pushWeeklyActs(worldState, week + 1); + // Current nightwave season was introduced in 38.0.8 so omitting challenges before that to avoid UI bugs and even crashes on really old versions. + if (!buildLabel || version_compare(buildLabel, "2025.02.05.11.19") >= 0) { + worldState.SeasonInfo.ActiveChallenges.push(getSeasonDailyChallenge(day - 2)); + worldState.SeasonInfo.ActiveChallenges.push(getSeasonDailyChallenge(day - 1)); + worldState.SeasonInfo.ActiveChallenges.push(getSeasonDailyChallenge(day - 0)); + if (isBeforeNextExpectedWorldStateRefresh(EPOCH + (day + 1) * 86400000)) { + worldState.SeasonInfo.ActiveChallenges.push(getSeasonDailyChallenge(day + 1)); + } + pushWeeklyActs(worldState, week); + if (isBeforeNextExpectedWorldStateRefresh(weekEnd)) { + pushWeeklyActs(worldState, week + 1); + } } // Elite Sanctuary Onslaught cycling every week -- 2.47.2