diff --git a/project/src/services/ProfileFixerService.ts b/project/src/services/ProfileFixerService.ts index 5fa830f4..8cf2d2cf 100644 --- a/project/src/services/ProfileFixerService.ts +++ b/project/src/services/ProfileFixerService.ts @@ -287,9 +287,9 @@ export class ProfileFixerService { } // For started or successful quests, check for unlocks in the `Started` rewards - if (profileQuest.status == QuestStatus.Started || profileQuest.status == QuestStatus.Success) { + if (profileQuest.status === QuestStatus.Started || profileQuest.status === QuestStatus.Success) { const productionRewards = quest.rewards.Started?.filter( - (reward) => reward.type == QuestRewardType.PRODUCTIONS_SCHEME, + (reward) => reward.type === QuestRewardType.PRODUCTIONS_SCHEME, ); productionRewards?.forEach((reward) => this.verifyQuestProductionUnlock(pmcProfile, reward, quest)); } @@ -297,7 +297,7 @@ export class ProfileFixerService { // For successful quests, check for unlocks in the `Success` rewards if (profileQuest.status == QuestStatus.Success) { const productionRewards = quest.rewards.Success?.filter( - (reward) => reward.type == QuestRewardType.PRODUCTIONS_SCHEME, + (reward) => reward.type === QuestRewardType.PRODUCTIONS_SCHEME, ); productionRewards?.forEach((reward) => this.verifyQuestProductionUnlock(pmcProfile, reward, quest)); } diff --git a/project/src/services/SeasonalEventService.ts b/project/src/services/SeasonalEventService.ts index 221aa257..a6310114 100644 --- a/project/src/services/SeasonalEventService.ts +++ b/project/src/services/SeasonalEventService.ts @@ -501,10 +501,29 @@ export class SeasonalEventService { this.databaseService.getLocation(locationId).base.waves = []; } - const activeMaps = Object.keys(zombieSettings.mapInfectionAmount).filter( - (locationId) => zombieSettings.mapInfectionAmount[locationId] > 0, + const locationsWithActiveInfection = this.getLocationsWithZombies(zombieSettings.mapInfectionAmount); + this.addEventBossesToMaps("halloweenzombies", locationsWithActiveInfection); + } + + /** + * Get location ids of maps with an infection above 0 + * @param locationInfections Dict of locations with their infection percentage + * @returns Array of location ids + */ + protected getLocationsWithZombies(locationInfections: Record): string[] { + const result: string[] = []; + + // Get only the locations with an infection above 0 + const infectionKeys = Object.keys(locationInfections).filter( + (locationId) => locationInfections[locationId] > 0, ); - this.addEventBossesToMaps("halloweenzombies", activeMaps); + + // Convert the infected location id into its generic location id + for (const locationkey of infectionKeys) { + result.push(...this.getLocationFromInfectedLocation(locationkey)); + } + + return result; } /**