From 9d53d153020495ff970b5c544b4508186744707d Mon Sep 17 00:00:00 2001 From: Chomp Date: Tue, 17 Aug 2021 17:32:27 +0100 Subject: [PATCH] better handle parsing a bot type where no raw bots were found --- Generator/BaseBotGenerator.cs | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/Generator/BaseBotGenerator.cs b/Generator/BaseBotGenerator.cs index cc99d7d..5b700a9 100644 --- a/Generator/BaseBotGenerator.cs +++ b/Generator/BaseBotGenerator.cs @@ -54,6 +54,12 @@ namespace Generator var rawBotsOfSameType = _rawParsedBots .Where(x => string.Equals(x.Info.Settings.Role, botToUpdate.botType.ToString(), StringComparison.OrdinalIgnoreCase)).ToList(); + if (rawBotsOfSameType.Count == 0) + { + Console.WriteLine($"no bots of type {botToUpdate.botType.ToString()}"); + break; + } + UpdateBodyPartHealth(botToUpdate, rawBotsOfSameType); AddDifficulties(botToUpdate, _workingPath); AddExperience(botToUpdate, rawBotsOfSameType);