From: Simon <63975668+Simyon264@users.noreply.github.com> Date: Tue, 2 Apr 2024 05:18:31 +0000 (+0200) Subject: Make cyborgs hands explosion proof. (#26515) X-Git-Url: https://git.smokeofanarchy.ru/gitweb.cgi?a=commitdiff_plain;h=307a1c534dd132c8ce90b6fed79135452601a0b3;p=space-station-14.git Make cyborgs hands explosion proof. (#26515) * Make the advanced treatment modules beakers explosion-proof. * undo changes * Epic rename fail * Explosion recursion data field * Logic for data field --- diff --git a/Content.Server/Hands/Systems/HandsSystem.cs b/Content.Server/Hands/Systems/HandsSystem.cs index 06946cd052..bfd6393790 100644 --- a/Content.Server/Hands/Systems/HandsSystem.cs +++ b/Content.Server/Hands/Systems/HandsSystem.cs @@ -75,6 +75,9 @@ namespace Content.Server.Hands.Systems private void OnExploded(Entity ent, ref BeforeExplodeEvent args) { + if (ent.Comp.DisableExplosionRecursion) + return; + foreach (var hand in ent.Comp.Hands.Values) { if (hand.HeldEntity is { } uid) diff --git a/Content.Shared/Hands/Components/HandsComponent.cs b/Content.Shared/Hands/Components/HandsComponent.cs index 904b10b3bd..f1f25a69f7 100644 --- a/Content.Shared/Hands/Components/HandsComponent.cs +++ b/Content.Shared/Hands/Components/HandsComponent.cs @@ -31,6 +31,12 @@ public sealed partial class HandsComponent : Component /// public List SortedHands = new(); + /// + /// If true, the items in the hands won't be affected by explosions. + /// + [DataField] + public bool DisableExplosionRecursion = false; + /// /// The amount of throw impulse per distance the player is from the throw target. /// diff --git a/Resources/Prototypes/Entities/Mobs/Cyborgs/base_borg_chassis.yml b/Resources/Prototypes/Entities/Mobs/Cyborgs/base_borg_chassis.yml index f04998388b..df5b8d7519 100644 --- a/Resources/Prototypes/Entities/Mobs/Cyborgs/base_borg_chassis.yml +++ b/Resources/Prototypes/Entities/Mobs/Cyborgs/base_borg_chassis.yml @@ -83,6 +83,7 @@ templateId: borg - type: Hands showInHands: false + disableExplosionRecursion: true - type: IntrinsicRadioReceiver - type: IntrinsicRadioTransmitter channels: