1
0

NotCommandRequirementSystem.cs 711 B

123456789101112131415161718192021222324
  1. using Content.Server.Objectives.Components;
  2. using Content.Server.Revolutionary.Components;
  3. using Content.Shared.Objectives.Components;
  4. namespace Content.Server.Objectives.Systems;
  5. public sealed class NotCommandRequirementSystem : EntitySystem
  6. {
  7. public override void Initialize()
  8. {
  9. base.Initialize();
  10. SubscribeLocalEvent<NotCommandRequirementComponent, RequirementCheckEvent>(OnCheck);
  11. }
  12. private void OnCheck(EntityUid uid, NotCommandRequirementComponent comp, ref RequirementCheckEvent args)
  13. {
  14. if (args.Cancelled)
  15. return;
  16. if (args.Mind.OwnedEntity is { } ent && HasComp<CommandStaffComponent>(ent))
  17. args.Cancelled = true;
  18. }
  19. }