diff --git a/Content.Server/Engineering/Components/SpawnAfterInteractComponent.cs b/Content.Server/Engineering/Components/SpawnAfterInteractComponent.cs index da3ad392307d..fe4e98ad7b8e 100644 --- a/Content.Server/Engineering/Components/SpawnAfterInteractComponent.cs +++ b/Content.Server/Engineering/Components/SpawnAfterInteractComponent.cs @@ -10,6 +10,10 @@ public sealed class SpawnAfterInteractComponent : Component [DataField("prototype", customTypeSerializer: typeof(PrototypeIdSerializer))] public string? Prototype { get; } + [ViewVariables] + [DataField("ignoreDistance")] + public bool IgnoreDistance { get; } + [ViewVariables] [DataField("doAfter")] public float DoAfterTime = 0; diff --git a/Content.Server/Engineering/EntitySystems/SpawnAfterInteractSystem.cs b/Content.Server/Engineering/EntitySystems/SpawnAfterInteractSystem.cs index 3119222e3721..0e20f699f990 100644 --- a/Content.Server/Engineering/EntitySystems/SpawnAfterInteractSystem.cs +++ b/Content.Server/Engineering/EntitySystems/SpawnAfterInteractSystem.cs @@ -25,6 +25,8 @@ public override void Initialize() private async void HandleAfterInteract(EntityUid uid, SpawnAfterInteractComponent component, AfterInteractEvent args) { + if (!args.CanReach && !component.IgnoreDistance) + return; if (string.IsNullOrEmpty(component.Prototype)) return; if (!_mapManager.TryGetGrid(args.ClickLocation.GetGridId(EntityManager), out var grid))