diff --git a/Content.Server/Engineering/Components/SpawnAfterInteractComponent.cs b/Content.Server/Engineering/Components/SpawnAfterInteractComponent.cs index da3ad39230..fe4e98ad7b 100644 --- a/Content.Server/Engineering/Components/SpawnAfterInteractComponent.cs +++ b/Content.Server/Engineering/Components/SpawnAfterInteractComponent.cs @@ -10,6 +10,10 @@ namespace Content.Server.Engineering.Components [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 3119222e37..0e20f699f9 100644 --- a/Content.Server/Engineering/EntitySystems/SpawnAfterInteractSystem.cs +++ b/Content.Server/Engineering/EntitySystems/SpawnAfterInteractSystem.cs @@ -25,6 +25,8 @@ namespace Content.Server.Engineering.EntitySystems 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))