From 0494ccacefcb350637d035784ee7fc192ac89aea Mon Sep 17 00:00:00 2001 From: Chomp Date: Tue, 17 Aug 2021 15:41:35 +0100 Subject: [PATCH] fall back to first non-null settings file when applying difficulty settings --- Generator/Helpers/DifficultyHelper.cs | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/Generator/Helpers/DifficultyHelper.cs b/Generator/Helpers/DifficultyHelper.cs index 7e3c930..62da0e6 100644 --- a/Generator/Helpers/DifficultyHelper.cs +++ b/Generator/Helpers/DifficultyHelper.cs @@ -30,6 +30,13 @@ namespace Generator.Helpers { var settings = difficultySettingsJsons.FirstOrDefault(x => x.Key.Contains(difficulty)); + // No difficulty settings found, find any settings file and use that + // This is required for many bot types that only have 'normal' difficulty settings + if (settings.Key == null) + { + settings = difficultySettingsJsons.FirstOrDefault(x => x.Key != null); + } + SaveSettingsIntoBotFile(bot, difficulty, settings.Value); } }