From: beck-thompson <107373427+beck-thompson@users.noreply.github.com> Date: Mon, 16 Jun 2025 22:54:11 +0000 (-0700) Subject: Objectives that do not fit requirements are now deleted (#38365) X-Git-Url: https://git.smokeofanarchy.ru/gitweb.cgi?a=commitdiff_plain;h=a48c390854cb8b649d315f16ef7c3b6258f1b93b;p=space-station-14.git 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 --- 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; } }