From d93b2506531d450e062da07314aeaf3071db5c45 Mon Sep 17 00:00:00 2001 From: Flipp Syder <76629141+vulppine@users.noreply.github.com> Date: Tue, 24 May 2022 19:34:39 -0700 Subject: [PATCH] Inflatable wall fix (#8409) * adds a check for canreach in SpawnAfterInteract * adds a check for the new field --- .../Engineering/Components/SpawnAfterInteractComponent.cs | 4 ++++ .../Engineering/EntitySystems/SpawnAfterInteractSystem.cs | 2 ++ 2 files changed, 6 insertions(+) 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))