From: Cojoke <83733158+Cojoke-dot@users.noreply.github.com> Date: Mon, 19 Aug 2024 11:56:40 +0000 (-0500) Subject: Fix Pacified Damage Dealing Thrown Objects (#31183) X-Git-Url: https://git.smokeofanarchy.ru/gitweb.cgi?a=commitdiff_plain;h=6c3dad433063c11617384f441f67840cd3f90d10;p=space-station-14.git Fix Pacified Damage Dealing Thrown Objects (#31183) --- diff --git a/Content.Server/Damage/Systems/DamageOtherOnHitSystem.cs b/Content.Server/Damage/Systems/DamageOtherOnHitSystem.cs index 8a7b3df0b2..8a35e471b4 100644 --- a/Content.Server/Damage/Systems/DamageOtherOnHitSystem.cs +++ b/Content.Server/Damage/Systems/DamageOtherOnHitSystem.cs @@ -1,6 +1,7 @@ using Content.Server.Administration.Logs; using Content.Server.Damage.Components; using Content.Server.Weapons.Ranged.Systems; +using Content.Shared.CombatMode.Pacification; using Content.Shared.Camera; using Content.Shared.Damage; using Content.Shared.Damage.Events; @@ -9,6 +10,7 @@ using Content.Shared.Database; using Content.Shared.Effects; using Content.Shared.Mobs.Components; using Content.Shared.Throwing; +using Content.Shared.Wires; using Robust.Shared.Physics.Components; using Robust.Shared.Player; @@ -28,6 +30,7 @@ namespace Content.Server.Damage.Systems { SubscribeLocalEvent(OnDoHit); SubscribeLocalEvent(OnDamageExamine); + SubscribeLocalEvent(OnAttemptPacifiedThrow); } private void OnDoHit(EntityUid uid, DamageOtherOnHitComponent component, ThrowDoHitEvent args) @@ -58,5 +61,13 @@ namespace Content.Server.Damage.Systems { _damageExamine.AddDamageExamine(args.Message, component.Damage, Loc.GetString("damage-throw")); } + + /// + /// Prevent players with the Pacified status effect from throwing things that deal damage. + /// + private void OnAttemptPacifiedThrow(Entity ent, ref AttemptPacifiedThrowEvent args) + { + args.Cancel("pacified-cannot-throw"); + } } } diff --git a/Content.Shared/Projectiles/SharedProjectileSystem.cs b/Content.Shared/Projectiles/SharedProjectileSystem.cs index 1f6f2b6918..1b7d6d6f99 100644 --- a/Content.Shared/Projectiles/SharedProjectileSystem.cs +++ b/Content.Shared/Projectiles/SharedProjectileSystem.cs @@ -38,7 +38,6 @@ public abstract partial class SharedProjectileSystem : EntitySystem SubscribeLocalEvent(OnEmbedThrowDoHit); SubscribeLocalEvent(OnEmbedActivate); SubscribeLocalEvent(OnEmbedRemove); - SubscribeLocalEvent(OnAttemptPacifiedThrow); } private void OnEmbedActivate(EntityUid uid, EmbeddableProjectileComponent component, ActivateInWorldEvent args) @@ -154,14 +153,6 @@ public abstract partial class SharedProjectileSystem : EntitySystem { public override DoAfterEvent Clone() => this; } - - /// - /// Prevent players with the Pacified status effect from throwing embeddable projectiles. - /// - private void OnAttemptPacifiedThrow(Entity ent, ref AttemptPacifiedThrowEvent args) - { - args.Cancel("pacified-cannot-throw-embed"); - } } [Serializable, NetSerializable]