Objectives that do not fit requirements are now deleted (#38365)
* Fix * Update Content.Server/Objectives/ObjectivesSystem.cs Thanks Tayrathn! Co-authored-by: Tayrtahn <tayrtahn@gmail.com> --------- Co-authored-by: Tayrtahn <tayrtahn@gmail.com>
This commit is contained in:
@@ -244,8 +244,10 @@ public sealed class ObjectivesSystem : SharedObjectivesSystem
|
|||||||
var objectives = group.Weights.ShallowClone();
|
var objectives = group.Weights.ShallowClone();
|
||||||
while (_random.TryPickAndTake(objectives, out var objectiveProto))
|
while (_random.TryPickAndTake(objectives, out var objectiveProto))
|
||||||
{
|
{
|
||||||
if (TryCreateObjective((mindId, mind), objectiveProto, out var objective)
|
if (!_prototypeManager.Index(objectiveProto).TryGetComponent<ObjectiveComponent>(out var objectiveComp, EntityManager.ComponentFactory))
|
||||||
&& Comp<ObjectiveComponent>(objective.Value).Difficulty <= maxDifficulty)
|
continue;
|
||||||
|
|
||||||
|
if (objectiveComp.Difficulty <= maxDifficulty && TryCreateObjective((mindId, mind), objectiveProto, out var objective))
|
||||||
return objective;
|
return objective;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user