diff --git a/Content.Server/Salvage/FultonSystem.cs b/Content.Server/Salvage/FultonSystem.cs index 323b71daea..a24bab4584 100644 --- a/Content.Server/Salvage/FultonSystem.cs +++ b/Content.Server/Salvage/FultonSystem.cs @@ -11,7 +11,6 @@ namespace Content.Server.Salvage; public sealed class FultonSystem : SharedFultonSystem { [Dependency] private readonly IRobustRandom _random = default!; - [Dependency] private readonly SharedContainerSystem _container = default!; public override void Initialize() { @@ -55,7 +54,8 @@ public sealed class FultonSystem : SharedFultonSystem { if (!Deleted(component.Beacon) && TryComp(component.Beacon, out var beaconXform) && - !_container.IsEntityOrParentInContainer(component.Beacon.Value, xform: beaconXform)) + !Container.IsEntityOrParentInContainer(component.Beacon.Value, xform: beaconXform) && + CanFulton(uid)) { var xform = Transform(uid); var metadata = MetaData(uid); diff --git a/Content.Shared/Salvage/Fulton/FultonComponent.cs b/Content.Shared/Salvage/Fulton/FultonComponent.cs index b3a0d46193..236ee18c3a 100644 --- a/Content.Shared/Salvage/Fulton/FultonComponent.cs +++ b/Content.Shared/Salvage/Fulton/FultonComponent.cs @@ -39,9 +39,8 @@ public sealed partial class FultonComponent : Component { Components = new[] { - "EntityStorage", "Item", - "ReagentTank", + "Anchorable" } }; diff --git a/Content.Shared/Salvage/Fulton/SharedFultonSystem.cs b/Content.Shared/Salvage/Fulton/SharedFultonSystem.cs index d678b14b92..adaef16608 100644 --- a/Content.Shared/Salvage/Fulton/SharedFultonSystem.cs +++ b/Content.Shared/Salvage/Fulton/SharedFultonSystem.cs @@ -26,6 +26,7 @@ public abstract partial class SharedFultonSystem : EntitySystem [Dependency] protected readonly SharedAudioSystem Audio = default!; [Dependency] private readonly SharedDoAfterSystem _doAfter = default!; [Dependency] private readonly FoldableSystem _foldable = default!; + [Dependency] protected readonly SharedContainerSystem Container = default!; [Dependency] private readonly SharedPopupSystem _popup = default!; [Dependency] private readonly SharedStackSystem _stack = default!; [Dependency] protected readonly SharedTransformSystem TransformSystem = default!; @@ -138,7 +139,7 @@ public abstract partial class SharedFultonSystem : EntitySystem return; } - if (!CanFulton(args.Target.Value, uid, component)) + if (!CanApplyFulton(args.Target.Value, component)) { _popup.PopupClient(Loc.GetString("fulton-invalid"), uid, uid); return; @@ -177,15 +178,27 @@ public abstract partial class SharedFultonSystem : EntitySystem return; } - private bool CanFulton(EntityUid targetUid, EntityUid uid, FultonComponent component) + protected bool CanApplyFulton(EntityUid targetUid, FultonComponent component) { - if (Transform(targetUid).Anchored) + if (!CanFulton(targetUid)) return false; if (component.Whitelist?.IsValid(targetUid, EntityManager) != true) - { return false; - } + + return true; + } + + protected bool CanFulton(EntityUid uid) + { + var xform = Transform(uid); + + if (xform.Anchored) + return false; + + // Shouldn't need recursive container checks I think. + if (Container.IsEntityInContainer(uid)) + return false; return true; }