From 6e262a228fb3da984f7aee1dfa5ba19e6dfb3c9c Mon Sep 17 00:00:00 2001 From: Dev Date: Tue, 23 Apr 2024 22:41:00 +0100 Subject: [PATCH] Add optional param to ignore raid settings chosen by player during `getAllBotDifficulties()` --- project/src/controllers/BotController.ts | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/project/src/controllers/BotController.ts b/project/src/controllers/BotController.ts index 908333a5..c2fafbfb 100644 --- a/project/src/controllers/BotController.ts +++ b/project/src/controllers/BotController.ts @@ -86,16 +86,17 @@ export class BotController * Adjust PMC settings to ensure they engage the correct bot types * @param type what bot the server is requesting settings for * @param diffLevel difficulty level server requested settings for + * @param ignoreRaidSettings should raid settings chosen pre-raid be ignored * @returns Difficulty object */ - public getBotDifficulty(type: string, diffLevel: string): Difficulty + public getBotDifficulty(type: string, diffLevel: string, ignoreRaidSettings = false): Difficulty { let difficulty = diffLevel.toLowerCase(); const raidConfig = this.applicationContext.getLatestValue(ContextVariableType.RAID_CONFIGURATION)?.getValue< IGetRaidConfigurationRequestData >(); - if (!raidConfig) + if (!(raidConfig || ignoreRaidSettings)) { this.logger.error( this.localisationService.getText("bot-missing_application_context", "RAID_CONFIGURATION"), @@ -158,7 +159,7 @@ export class BotController result[botType] = {}; for (const difficulty of botDifficulties) { - result[botType][difficulty] = this.getBotDifficulty(botType, difficulty); + result[botType][difficulty] = this.getBotDifficulty(botType, difficulty, true); } }