using Content.Server.Objectives.Components; using Content.Shared.Objectives.Components; using Content.Shared.Roles.Jobs; namespace Content.Server.Objectives.Systems; /// /// Handles checking the job blacklist for this objective. /// public sealed class NotJobRequirementSystem : EntitySystem { public override void Initialize() { base.Initialize(); SubscribeLocalEvent(OnCheck); } private void OnCheck(EntityUid uid, NotJobRequirementComponent comp, ref RequirementCheckEvent args) { if (args.Cancelled) return; // if player has no job then don't care if (!TryComp(args.MindId, out var job)) return; if (job.PrototypeId == comp.Job) args.Cancelled = true; } }