From 7159f3cca3df1d3c6dc382c2ee2f81715b3a44a5 Mon Sep 17 00:00:00 2001 From: Dev Date: Sun, 3 Nov 2024 23:25:49 +0000 Subject: [PATCH] Pass infection rate into `addEventBossesToMaps()` so only maps with value > 0 spawn zombies --- project/src/services/SeasonalEventService.ts | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/project/src/services/SeasonalEventService.ts b/project/src/services/SeasonalEventService.ts index 54e700b7..45d2dcaa 100644 --- a/project/src/services/SeasonalEventService.ts +++ b/project/src/services/SeasonalEventService.ts @@ -450,7 +450,7 @@ export class SeasonalEventService { this.databaseService.getLocation(locationId).base.waves = []; } - this.addEventBossesToMaps("halloweenzombies"); + this.addEventBossesToMaps("halloweenzombies", zombieSettings.mapInfectionAmount); } protected addEventWavesToMaps(eventType: string): void { @@ -476,8 +476,9 @@ export class SeasonalEventService { /** * Add event bosses to maps * @param eventType Seasonal event, e.g. HALLOWEEN/CHRISTMAS + * @param mapWhitelist Check if map should have bosses added */ - protected addEventBossesToMaps(eventType: string): void { + protected addEventBossesToMaps(eventType: string, mapWhitelist?: Record): void { const botsToAddPerMap = this.seasonalEventConfig.eventBossSpawns[eventType.toLowerCase()]; if (!botsToAddPerMap) { this.logger.warning(`Unable to add: ${eventType} bosses, eventBossSpawns is missing`); @@ -491,6 +492,11 @@ export class SeasonalEventService { this.logger.warning(`Unable to add: ${eventType} bosses to: ${mapKey}`); continue; } + + if (mapWhitelist && (mapWhitelist[mapKey] ?? 0) === 0) { + continue; + } + for (const boss of bossesToAdd) { const mapBosses: IBossLocationSpawn[] = locations[mapKey].base.BossLocationSpawn; if (!mapBosses.some((bossSpawn) => bossSpawn.BossName === boss.BossName)) {