Fixed null skills breaking generation

This commit is contained in:
Dev 2024-03-28 14:27:02 +00:00
parent 88554b8b31
commit cd679fe415

View File

@ -73,18 +73,12 @@ namespace Generator
skills.Add(bot.Skills.Common.Find(x => x.Id == skill.Id)); skills.Add(bot.Skills.Common.Find(x => x.Id == skill.Id));
} }
var min = skills.Min(x => x.Progress); var min = skills.Min(x => x?.Progress);
var max = skills.Max(x => x.Progress); var max = skills.Max(x => x?.Progress);
botToUpdate.skills.Common.Add(skill.Id, new MinMax(min, max)); if (min.HasValue && max.HasValue)
}
// Do any bots have mastering skills? debug time
foreach (var bot in rawBotsOfSameType)
{ {
if (bot.Skills.Mastering.Count > 0) botToUpdate.skills.Common.Add(skill.Id, new MinMax(min.Value, max.Value));
{
var x = 2;
} }
} }
} }