mirror of
https://github.com/sp-tarkov/server.git
synced 2025-02-13 01:30:44 -05:00
Fixed configureZombies()
incorrectly handling location ids
This commit is contained in:
parent
016fc2a51e
commit
6562d05142
@ -287,9 +287,9 @@ export class ProfileFixerService {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// For started or successful quests, check for unlocks in the `Started` rewards
|
// 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(
|
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));
|
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
|
// For successful quests, check for unlocks in the `Success` rewards
|
||||||
if (profileQuest.status == QuestStatus.Success) {
|
if (profileQuest.status == QuestStatus.Success) {
|
||||||
const productionRewards = quest.rewards.Success?.filter(
|
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));
|
productionRewards?.forEach((reward) => this.verifyQuestProductionUnlock(pmcProfile, reward, quest));
|
||||||
}
|
}
|
||||||
|
@ -501,10 +501,29 @@ export class SeasonalEventService {
|
|||||||
this.databaseService.getLocation(locationId).base.waves = [];
|
this.databaseService.getLocation(locationId).base.waves = [];
|
||||||
}
|
}
|
||||||
|
|
||||||
const activeMaps = Object.keys(zombieSettings.mapInfectionAmount).filter(
|
const locationsWithActiveInfection = this.getLocationsWithZombies(zombieSettings.mapInfectionAmount);
|
||||||
(locationId) => zombieSettings.mapInfectionAmount[locationId] > 0,
|
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;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
Loading…
x
Reference in New Issue
Block a user