Files
tbd-station-14/Content.Server/Objectives/Systems/NotCommandRequirementSystem.cs
Theodore Lukin c78b5ae83d Fix warden being and qm being not considered head for tot kill head objective (#32721)
* fixed warden being and qm being not considered head for traitor kill head objective

* fixed hypothetical warden traitor not getting disk objective

* change suggested by deltanedas

* cleanup

* cleanup

* fix

* changed as suggested

* removed a dot in the comment

* removed an empty line

* reformulation
2024-10-18 11:43:05 +02:00

25 lines
711 B
C#

using Content.Server.Objectives.Components;
using Content.Server.Revolutionary.Components;
using Content.Shared.Objectives.Components;
namespace Content.Server.Objectives.Systems;
public sealed class NotCommandRequirementSystem : EntitySystem
{
public override void Initialize()
{
base.Initialize();
SubscribeLocalEvent<NotCommandRequirementComponent, RequirementCheckEvent>(OnCheck);
}
private void OnCheck(EntityUid uid, NotCommandRequirementComponent comp, ref RequirementCheckEvent args)
{
if (args.Cancelled)
return;
if (args.Mind.OwnedEntity is { } ent && HasComp<CommandStaffComponent>(ent))
args.Cancelled = true;
}
}