* 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
25 lines
711 B
C#
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;
|
|
}
|
|
}
|