Improved logic used inside addEventBossesToMaps()
This commit is contained in:
parent
c652761873
commit
574300d8cb
@ -450,7 +450,10 @@ export class SeasonalEventService {
|
|||||||
this.databaseService.getLocation(locationId).base.waves = [];
|
this.databaseService.getLocation(locationId).base.waves = [];
|
||||||
}
|
}
|
||||||
|
|
||||||
this.addEventBossesToMaps("halloweenzombies", zombieSettings.mapInfectionAmount);
|
const activeMaps = Object.keys(zombieSettings.mapInfectionAmount).filter(
|
||||||
|
(locationId) => zombieSettings.mapInfectionAmount[locationId] > 0,
|
||||||
|
);
|
||||||
|
this.addEventBossesToMaps("halloweenzombies", activeMaps);
|
||||||
}
|
}
|
||||||
|
|
||||||
protected addEventWavesToMaps(eventType: string): void {
|
protected addEventWavesToMaps(eventType: string): void {
|
||||||
@ -476,9 +479,9 @@ export class SeasonalEventService {
|
|||||||
/**
|
/**
|
||||||
* Add event bosses to maps
|
* Add event bosses to maps
|
||||||
* @param eventType Seasonal event, e.g. HALLOWEEN/CHRISTMAS
|
* @param eventType Seasonal event, e.g. HALLOWEEN/CHRISTMAS
|
||||||
* @param mapWhitelist Check if map should have bosses added
|
* @param mapWhitelist OPTIONAL - Maps to add bosses to
|
||||||
*/
|
*/
|
||||||
protected addEventBossesToMaps(eventType: string, mapWhitelist?: Record<string, number>): void {
|
protected addEventBossesToMaps(eventType: string, mapIdWhitelist?: string[]): void {
|
||||||
const botsToAddPerMap = this.seasonalEventConfig.eventBossSpawns[eventType.toLowerCase()];
|
const botsToAddPerMap = this.seasonalEventConfig.eventBossSpawns[eventType.toLowerCase()];
|
||||||
if (!botsToAddPerMap) {
|
if (!botsToAddPerMap) {
|
||||||
this.logger.warning(`Unable to add: ${eventType} bosses, eventBossSpawns is missing`);
|
this.logger.warning(`Unable to add: ${eventType} bosses, eventBossSpawns is missing`);
|
||||||
@ -493,7 +496,7 @@ export class SeasonalEventService {
|
|||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (mapWhitelist && (mapWhitelist[mapKey] ?? 0) === 0) {
|
if (mapIdWhitelist && !mapIdWhitelist.includes(mapKey)) {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user