From: IProduceWidgets <107586145+IProduceWidgets@users.noreply.github.com> Date: Mon, 10 Feb 2025 01:24:10 +0000 (-0500) Subject: Allows pacifists to throw Items with DamageOnLand (#31060) X-Git-Url: https://git.smokeofanarchy.ru/gitweb.cgi?a=commitdiff_plain;h=fe064adaecf3acd3bc4896214fa4d6efaeb759cd;p=space-station-14.git Allows pacifists to throw Items with DamageOnLand (#31060) --- 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)