Fixed null skills breaking generation
This commit is contained in:
parent
88554b8b31
commit
cd679fe415
@ -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;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user