From ba164f9e48798f462bf5b6bd0d7b9b80a9022a22 Mon Sep 17 00:00:00 2001 From: mhamster <81412348+mhamsterr@users.noreply.github.com> Date: Sun, 23 Jun 2024 22:34:32 +0700 Subject: [PATCH] ContainmentFieldComponent's garbage destruction can now be disabled (#29376) * Garbage Vaporizer 3000 + DestroyGarbage bool property + DestroyGarbage property check when dealing with incoming trash * Update ContainmentFieldComponent.cs Co-authored-by: Tayrtahn --------- Co-authored-by: Tayrtahn --- .../Singularity/EntitySystems/ContainmentFieldSystem.cs | 2 +- .../Singularity/Components/ContainmentFieldComponent.cs | 6 ++++++ 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/Content.Server/Singularity/EntitySystems/ContainmentFieldSystem.cs b/Content.Server/Singularity/EntitySystems/ContainmentFieldSystem.cs index 561db76a47..3944e94c20 100644 --- a/Content.Server/Singularity/EntitySystems/ContainmentFieldSystem.cs +++ b/Content.Server/Singularity/EntitySystems/ContainmentFieldSystem.cs @@ -26,7 +26,7 @@ public sealed class ContainmentFieldSystem : EntitySystem { var otherBody = args.OtherEntity; - if (HasComp(otherBody)) + if (component.DestroyGarbage && HasComp(otherBody)) { _popupSystem.PopupEntity(Loc.GetString("comp-field-vaporized", ("entity", otherBody)), uid, PopupType.LargeCaution); QueueDel(otherBody); diff --git a/Content.Shared/Singularity/Components/ContainmentFieldComponent.cs b/Content.Shared/Singularity/Components/ContainmentFieldComponent.cs index 43163a0c5c..621bbe8ff9 100644 --- a/Content.Shared/Singularity/Components/ContainmentFieldComponent.cs +++ b/Content.Shared/Singularity/Components/ContainmentFieldComponent.cs @@ -18,4 +18,10 @@ public sealed partial class ContainmentFieldComponent : Component /// [DataField("maxMass")] public float MaxMass = 10000f; + + /// + /// Should field vaporize garbage that collides with it? + /// + [DataField] + public bool DestroyGarbage = true; } -- 2.51.2