]> git.smokeofanarchy.ru Git - space-station-14.git/commitdiff
Make cyborgs hands explosion proof. (#26515)
authorSimon <63975668+Simyon264@users.noreply.github.com>
Tue, 2 Apr 2024 05:18:31 +0000 (07:18 +0200)
committerGitHub <noreply@github.com>
Tue, 2 Apr 2024 05:18:31 +0000 (22:18 -0700)
* Make the advanced treatment modules beakers explosion-proof.

* undo changes

* Epic rename fail

* Explosion recursion data field

* Logic for data field

Content.Server/Hands/Systems/HandsSystem.cs
Content.Shared/Hands/Components/HandsComponent.cs
Resources/Prototypes/Entities/Mobs/Cyborgs/base_borg_chassis.yml

index 06946cd05229852d8affa73fc11945be2e613a56..bfd6393790ad203f48e32817f548bced930f64d5 100644 (file)
@@ -75,6 +75,9 @@ namespace Content.Server.Hands.Systems
 
         private void OnExploded(Entity<HandsComponent> ent, ref BeforeExplodeEvent args)
         {
+            if (ent.Comp.DisableExplosionRecursion)
+                return;
+
             foreach (var hand in ent.Comp.Hands.Values)
             {
                 if (hand.HeldEntity is { } uid)
index 904b10b3bdca6c7a57d0470320db6bb7990ac36b..f1f25a69f7a58997077cd8f8983ea69843688667 100644 (file)
@@ -31,6 +31,12 @@ public sealed partial class HandsComponent : Component
     /// </summary>
     public List<string> SortedHands = new();
 
+    /// <summary>
+    ///     If true, the items in the hands won't be affected by explosions.
+    /// </summary>
+    [DataField]
+    public bool DisableExplosionRecursion = false;
+
     /// <summary>
     ///     The amount of throw impulse per distance the player is from the throw target.
     /// </summary>
index f04998388b8961eebb7adefa41efa9cc75a29aa7..df5b8d7519caefa1f6cedd6a785a4bc2d882e1c4 100644 (file)
@@ -83,6 +83,7 @@
     templateId: borg
   - type: Hands
     showInHands: false
+    disableExplosionRecursion: true
   - type: IntrinsicRadioReceiver
   - type: IntrinsicRadioTransmitter
     channels: