forked from chomp/BotGenerator
Fix bosses not finding their difficulty files
This commit is contained in:
parent
b74592e522
commit
01cd594ca2
@ -97,7 +97,7 @@ namespace Generator
|
|||||||
{
|
{
|
||||||
var botFiles = Directory
|
var botFiles = Directory
|
||||||
.GetFiles($"{workingPath}//Assets", "*.txt", SearchOption.TopDirectoryOnly)
|
.GetFiles($"{workingPath}//Assets", "*.txt", SearchOption.TopDirectoryOnly)
|
||||||
.Where(x => x.Contains(bot.botType.ToString()))
|
.Where(x => x.Contains(bot.botType.ToString(), StringComparison.InvariantCultureIgnoreCase))
|
||||||
.ToList();
|
.ToList();
|
||||||
|
|
||||||
DifficultyHelper.AddDifficultySettings(bot, botFiles);
|
DifficultyHelper.AddDifficultySettings(bot, botFiles);
|
||||||
|
@ -16,7 +16,7 @@ namespace Generator.Helpers
|
|||||||
// Read bot setting files from assets folder that match this bots type
|
// Read bot setting files from assets folder that match this bots type
|
||||||
// Save into dictionary with difficulty as key
|
// Save into dictionary with difficulty as key
|
||||||
var difficultySettingsJsons = new Dictionary<string, DifficultySettings>();
|
var difficultySettingsJsons = new Dictionary<string, DifficultySettings>();
|
||||||
foreach (var path in difficultyFilePaths.Where(x=>x.Contains(bot.botType.ToString())))
|
foreach (var path in difficultyFilePaths.Where(x=>x.Contains(bot.botType.ToString(), System.StringComparison.InvariantCultureIgnoreCase)))
|
||||||
{
|
{
|
||||||
var json = File.ReadAllText(path);
|
var json = File.ReadAllText(path);
|
||||||
var serialisedObject = JsonConvert.DeserializeObject<DifficultySettings>(json);
|
var serialisedObject = JsonConvert.DeserializeObject<DifficultySettings>(json);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user