]> git.smokeofanarchy.ru Git - space-station-14.git/commitdiff
Allows pacifists to throw Items with DamageOnLand (#31060)
authorIProduceWidgets <107586145+IProduceWidgets@users.noreply.github.com>
Mon, 10 Feb 2025 01:24:10 +0000 (20:24 -0500)
committerGitHub <noreply@github.com>
Mon, 10 Feb 2025 01:24:10 +0000 (20:24 -0500)
Content.Server/Damage/Components/DamageOnLandComponent.cs
Content.Server/Damage/Systems/DamageOnLandSystem.cs

index b7c5644f826d106f4eb273bad87138444f804d8c..b2af72bd1245ace99f1caa7604e8634a0b144ea3 100644 (file)
@@ -5,10 +5,16 @@ namespace Content.Server.Damage.Components
     [RegisterComponent]
     public sealed partial class DamageOnLandComponent : Component
     {
+        /// <summary>
+        /// Should this entity be damaged when it lands regardless of its resistances?
+        /// </summary>
         [DataField("ignoreResistances")]
         [ViewVariables(VVAccess.ReadWrite)]
         public bool IgnoreResistances = false;
 
+        /// <summary>
+        /// How much damage.
+        /// </summary>
         [DataField("damage", required: true)]
         [ViewVariables(VVAccess.ReadWrite)]
         public DamageSpecifier Damage = default!;
index 2e72e76e6d8361966647057d12c2a2d47ecee595..3cf103e6eeec35b80f84a57fb8f7441b8c146279 100644 (file)
@@ -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
 {
+    /// <summary>
+    /// Damages the thrown item when it lands.
+    /// </summary>
     public sealed class DamageOnLandSystem : EntitySystem
     {
         [Dependency] private readonly DamageableSystem _damageableSystem = default!;
@@ -13,19 +15,6 @@ namespace Content.Server.Damage.Systems
         {
             base.Initialize();
             SubscribeLocalEvent<DamageOnLandComponent, LandEvent>(DamageOnLand);
-            SubscribeLocalEvent<DamageOnLandComponent, AttemptPacifiedThrowEvent>(OnAttemptPacifiedThrow);
-        }
-
-        /// <summary>
-        /// Prevent Pacified entities from throwing damaging items.
-        /// </summary>
-        private void OnAttemptPacifiedThrow(Entity<DamageOnLandComponent> 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)