* Fix
* Update Content.Server/Objectives/ObjectivesSystem.cs
Thanks Tayrathn!
Co-authored-by: Tayrtahn <tayrtahn@gmail.com>
---------
Co-authored-by: Tayrtahn <tayrtahn@gmail.com>
var objectives = group.Weights.ShallowClone();
while (_random.TryPickAndTake(objectives, out var objectiveProto))
{
- if (TryCreateObjective((mindId, mind), objectiveProto, out var objective)
- && Comp<ObjectiveComponent>(objective.Value).Difficulty <= maxDifficulty)
+ if (!_prototypeManager.Index(objectiveProto).TryGetComponent<ObjectiveComponent>(out var objectiveComp, EntityManager.ComponentFactory))
+ continue;
+
+ if (objectiveComp.Difficulty <= maxDifficulty && TryCreateObjective((mindId, mind), objectiveProto, out var objective))
return objective;
}
}