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 <tayrtahn@gmail.com>

---------

Co-authored-by: Tayrtahn <tayrtahn@gmail.com>
This commit is contained in:
mhamster
2024-06-23 22:34:32 +07:00
committed by GitHub
parent 0c34eb6138
commit ba164f9e48
2 changed files with 7 additions and 1 deletions

View File

@@ -26,7 +26,7 @@ public sealed class ContainmentFieldSystem : EntitySystem
{
var otherBody = args.OtherEntity;
if (HasComp<SpaceGarbageComponent>(otherBody))
if (component.DestroyGarbage && HasComp<SpaceGarbageComponent>(otherBody))
{
_popupSystem.PopupEntity(Loc.GetString("comp-field-vaporized", ("entity", otherBody)), uid, PopupType.LargeCaution);
QueueDel(otherBody);

View File

@@ -18,4 +18,10 @@ public sealed partial class ContainmentFieldComponent : Component
/// </summary>
[DataField("maxMass")]
public float MaxMass = 10000f;
/// <summary>
/// Should field vaporize garbage that collides with it?
/// </summary>
[DataField]
public bool DestroyGarbage = true;
}