From a48c390854cb8b649d315f16ef7c3b6258f1b93b Mon Sep 17 00:00:00 2001 From: beck-thompson <107373427+beck-thompson@users.noreply.github.com> Date: Mon, 16 Jun 2025 15:54:11 -0700 Subject: [PATCH] Objectives that do not fit requirements are now deleted (#38365) * Fix * Update Content.Server/Objectives/ObjectivesSystem.cs Thanks Tayrathn! Co-authored-by: Tayrtahn --------- Co-authored-by: Tayrtahn --- Content.Server/Objectives/ObjectivesSystem.cs | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/Content.Server/Objectives/ObjectivesSystem.cs b/Content.Server/Objectives/ObjectivesSystem.cs index 39effb9bdb..1b20d65c45 100644 --- a/Content.Server/Objectives/ObjectivesSystem.cs +++ b/Content.Server/Objectives/ObjectivesSystem.cs @@ -244,8 +244,10 @@ public sealed class ObjectivesSystem : SharedObjectivesSystem var objectives = group.Weights.ShallowClone(); while (_random.TryPickAndTake(objectives, out var objectiveProto)) { - if (TryCreateObjective((mindId, mind), objectiveProto, out var objective) - && Comp(objective.Value).Difficulty <= maxDifficulty) + if (!_prototypeManager.Index(objectiveProto).TryGetComponent(out var objectiveComp, EntityManager.ComponentFactory)) + continue; + + if (objectiveComp.Difficulty <= maxDifficulty && TryCreateObjective((mindId, mind), objectiveProto, out var objective)) return objective; } } -- 2.51.2