Don't fail to start server if invalid jobs exist in preferences.

This commit is contained in:
Pieter-Jan Briers
2020-12-18 23:55:29 +01:00
parent 19bd739b0d
commit 9bb42d5251

View File

@@ -45,7 +45,11 @@ namespace Content.Server.GameTicking
.Where(j => .Where(j =>
{ {
var (jobId, priority) = j; var (jobId, priority) = j;
var job = _prototypeManager.Index<JobPrototype>(jobId); if (!_prototypeManager.TryIndex(jobId, out JobPrototype job))
{
// Job doesn't exist, probably old data?
return false;
}
if (job.IsHead != heads) if (job.IsHead != heads)
{ {
return false; return false;