From fe064adaecf3acd3bc4896214fa4d6efaeb759cd Mon Sep 17 00:00:00 2001 From: IProduceWidgets <107586145+IProduceWidgets@users.noreply.github.com> Date: Sun, 9 Feb 2025 20:24:10 -0500 Subject: [PATCH] Allows pacifists to throw Items with DamageOnLand (#31060) --- .../Damage/Components/DamageOnLandComponent.cs | 6 ++++++ .../Damage/Systems/DamageOnLandSystem.cs | 17 +++-------------- 2 files changed, 9 insertions(+), 14 deletions(-) diff --git a/Content.Server/Damage/Components/DamageOnLandComponent.cs b/Content.Server/Damage/Components/DamageOnLandComponent.cs index b7c5644f82..b2af72bd12 100644 --- a/Content.Server/Damage/Components/DamageOnLandComponent.cs +++ b/Content.Server/Damage/Components/DamageOnLandComponent.cs @@ -5,10 +5,16 @@ namespace Content.Server.Damage.Components [RegisterComponent] public sealed partial class DamageOnLandComponent : Component { + /// + /// Should this entity be damaged when it lands regardless of its resistances? + /// [DataField("ignoreResistances")] [ViewVariables(VVAccess.ReadWrite)] public bool IgnoreResistances = false; + /// + /// How much damage. + /// [DataField("damage", required: true)] [ViewVariables(VVAccess.ReadWrite)] public DamageSpecifier Damage = default!; diff --git a/Content.Server/Damage/Systems/DamageOnLandSystem.cs b/Content.Server/Damage/Systems/DamageOnLandSystem.cs index 2e72e76e6d..3cf103e6ee 100644 --- a/Content.Server/Damage/Systems/DamageOnLandSystem.cs +++ b/Content.Server/Damage/Systems/DamageOnLandSystem.cs @@ -1,10 +1,12 @@ using Content.Server.Damage.Components; -using Content.Shared.CombatMode.Pacification; using Content.Shared.Damage; using Content.Shared.Throwing; namespace Content.Server.Damage.Systems { + /// + /// Damages the thrown item when it lands. + /// public sealed class DamageOnLandSystem : EntitySystem { [Dependency] private readonly DamageableSystem _damageableSystem = default!; @@ -13,19 +15,6 @@ namespace Content.Server.Damage.Systems { base.Initialize(); SubscribeLocalEvent(DamageOnLand); - SubscribeLocalEvent(OnAttemptPacifiedThrow); - } - - /// - /// Prevent Pacified entities from throwing damaging items. - /// - private void OnAttemptPacifiedThrow(Entity ent, ref AttemptPacifiedThrowEvent args) - { - // Allow healing projectiles, forbid any that do damage: - if (ent.Comp.Damage.AnyPositive()) - { - args.Cancel("pacified-cannot-throw"); - } } private void DamageOnLand(EntityUid uid, DamageOnLandComponent component, ref LandEvent args) -- 2.51.2