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
This commit is contained in:
@@ -75,6 +75,9 @@ namespace Content.Server.Hands.Systems
|
|||||||
|
|
||||||
private void OnExploded(Entity<HandsComponent> ent, ref BeforeExplodeEvent args)
|
private void OnExploded(Entity<HandsComponent> ent, ref BeforeExplodeEvent args)
|
||||||
{
|
{
|
||||||
|
if (ent.Comp.DisableExplosionRecursion)
|
||||||
|
return;
|
||||||
|
|
||||||
foreach (var hand in ent.Comp.Hands.Values)
|
foreach (var hand in ent.Comp.Hands.Values)
|
||||||
{
|
{
|
||||||
if (hand.HeldEntity is { } uid)
|
if (hand.HeldEntity is { } uid)
|
||||||
|
|||||||
@@ -31,6 +31,12 @@ public sealed partial class HandsComponent : Component
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
public List<string> SortedHands = new();
|
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>
|
/// <summary>
|
||||||
/// The amount of throw impulse per distance the player is from the throw target.
|
/// The amount of throw impulse per distance the player is from the throw target.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
|||||||
@@ -83,6 +83,7 @@
|
|||||||
templateId: borg
|
templateId: borg
|
||||||
- type: Hands
|
- type: Hands
|
||||||
showInHands: false
|
showInHands: false
|
||||||
|
disableExplosionRecursion: true
|
||||||
- type: IntrinsicRadioReceiver
|
- type: IntrinsicRadioReceiver
|
||||||
- type: IntrinsicRadioTransmitter
|
- type: IntrinsicRadioTransmitter
|
||||||
channels:
|
channels:
|
||||||
|
|||||||
Reference in New Issue
Block a user