diff --git a/Content.Shared/CombatMode/Pacification/PacificationSystem.cs b/Content.Shared/CombatMode/Pacification/PacificationSystem.cs index d55aba6619..86825e4096 100644 --- a/Content.Shared/CombatMode/Pacification/PacificationSystem.cs +++ b/Content.Shared/CombatMode/Pacification/PacificationSystem.cs @@ -1,18 +1,26 @@ using Content.Shared.Actions; +using Content.Shared.Interaction.Events; namespace Content.Shared.CombatMode.Pacification { public sealed class PacificationSystem : EntitySystem { [Dependency] private readonly SharedActionsSystem _actionsSystem = default!; + public override void Initialize() { base.Initialize(); - SubscribeLocalEvent(OnInit); + SubscribeLocalEvent(OnStartup); SubscribeLocalEvent(OnShutdown); + SubscribeLocalEvent(OnAttackAttempt); } - private void OnInit(EntityUid uid, PacifiedComponent component, ComponentInit args) + private void OnAttackAttempt(EntityUid uid, PacifiedComponent component, AttackAttemptEvent args) + { + args.Cancel(); + } + + private void OnStartup(EntityUid uid, PacifiedComponent component, ComponentStartup args) { if (!TryComp(uid, out var combatMode)) return; @@ -34,6 +42,7 @@ namespace Content.Shared.CombatMode.Pacification if (combatMode.CanDisarm != null) combatMode.CanDisarm = true; + if (combatMode.CombatToggleAction != null) _actionsSystem.SetEnabled(combatMode.CombatToggleAction, true); } diff --git a/Content.Shared/CombatMode/Pacification/PacifiedComponent.cs b/Content.Shared/CombatMode/Pacification/PacifiedComponent.cs index c20e97bfd2..393c513b7f 100644 --- a/Content.Shared/CombatMode/Pacification/PacifiedComponent.cs +++ b/Content.Shared/CombatMode/Pacification/PacifiedComponent.cs @@ -5,5 +5,7 @@ namespace Content.Shared.CombatMode.Pacification /// [RegisterComponent] public sealed class PacifiedComponent : Component - {} + { + + } }