From 4dc11acf0643561e75e551f1f53b191ebfcdc88d Mon Sep 17 00:00:00 2001 From: Chomp Date: Tue, 17 Aug 2021 18:34:37 +0100 Subject: [PATCH] Handle when a bot type is similar to another, e.g. cursedassault vs assault --- Generator/Helpers/DifficultyHelper.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Generator/Helpers/DifficultyHelper.cs b/Generator/Helpers/DifficultyHelper.cs index 4bd9d7c..d6c1eb7 100644 --- a/Generator/Helpers/DifficultyHelper.cs +++ b/Generator/Helpers/DifficultyHelper.cs @@ -16,7 +16,7 @@ namespace Generator.Helpers // Read bot setting files from assets folder that match this bots type // Save into dictionary with difficulty as key var difficultySettingsJsons = new Dictionary(); - foreach (var path in difficultyFilePaths.Where(x=>x.Contains(bot.botType.ToString(), System.StringComparison.InvariantCultureIgnoreCase))) + foreach (var path in difficultyFilePaths.Where(x=>x.Contains($"_{bot.botType.ToString()}", System.StringComparison.InvariantCultureIgnoreCase))) { var json = File.ReadAllText(path); var serialisedObject = JsonConvert.DeserializeObject(json);