From cd679fe415c11923d8575077f6f084a5c00aa862 Mon Sep 17 00:00:00 2001 From: Dev Date: Thu, 28 Mar 2024 14:27:02 +0000 Subject: [PATCH] Fixed null skills breaking generation --- Generator/BaseBotGenerator.cs | 14 ++++---------- 1 file changed, 4 insertions(+), 10 deletions(-) diff --git a/Generator/BaseBotGenerator.cs b/Generator/BaseBotGenerator.cs index 4a7e6fe..9dda1ec 100644 --- a/Generator/BaseBotGenerator.cs +++ b/Generator/BaseBotGenerator.cs @@ -73,18 +73,12 @@ namespace Generator skills.Add(bot.Skills.Common.Find(x => x.Id == skill.Id)); } - var min = skills.Min(x => x.Progress); - var max = skills.Max(x => x.Progress); + var min = skills.Min(x => x?.Progress); + var max = skills.Max(x => x?.Progress); - botToUpdate.skills.Common.Add(skill.Id, new MinMax(min, max)); - } - - // Do any bots have mastering skills? debug time - foreach (var bot in rawBotsOfSameType) - { - if (bot.Skills.Mastering.Count > 0) + if (min.HasValue && max.HasValue) { - var x = 2; + botToUpdate.skills.Common.Add(skill.Id, new MinMax(min.Value, max.Value)); } } }