0
0
mirror of https://github.com/sp-tarkov/server.git synced 2025-02-12 16:10:43 -05:00

Fixed configureZombies() incorrectly handling location ids

This commit is contained in:
Chomp 2024-12-01 10:21:47 +00:00
parent 016fc2a51e
commit 6562d05142
2 changed files with 25 additions and 6 deletions

View File

@ -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));
}

View File

@ -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, number>): 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;
}
/**