forked from chomp/BotGenerator
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));
|
||||
}
|
||||
|
||||
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 (min.HasValue && max.HasValue)
|
||||
{
|
||||
if (bot.Skills.Mastering.Count > 0)
|
||||
{
|
||||
var x = 2;
|
||||
botToUpdate.skills.Common.Add(skill.Id, new MinMax(min.Value, max.Value));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user