fix: array out of bounds when processing CalendarProgress

This commit is contained in:
Sainan 2025-06-27 00:37:00 +02:00 committed by Sainan
parent d79e7c0274
commit d8ff601be7

View File

@ -674,7 +674,7 @@ export const addMissionInventoryUpdates = async (
const calendarProgress = getCalendarProgress(inventory); const calendarProgress = getCalendarProgress(inventory);
const currentSeason = getWorldState().KnownCalendarSeasons[0]; const currentSeason = getWorldState().KnownCalendarSeasons[0];
calendarProgress.SeasonProgress.LastCompletedChallengeDayIdx = currentSeason.Days.findIndex( calendarProgress.SeasonProgress.LastCompletedChallengeDayIdx = currentSeason.Days.findIndex(
x => x.events[0].challenge == value[value.length - 1].challenge day => day.events.length != 0 && day.events[0].challenge == value[value.length - 1].challenge
); );
checkCalendarChallengeCompletion(calendarProgress, currentSeason); checkCalendarChallengeCompletion(calendarProgress, currentSeason);
break; break;