Inflatable wall fix (#8409)

* adds a check for canreach in SpawnAfterInteract

* adds a check for the new field
This commit is contained in:
Flipp Syder
2022-05-24 19:34:39 -07:00
committed by GitHub
parent 369b22143f
commit d93b250653
2 changed files with 6 additions and 0 deletions

View File

@@ -10,6 +10,10 @@ namespace Content.Server.Engineering.Components
[DataField("prototype", customTypeSerializer: typeof(PrototypeIdSerializer<EntityPrototype>))] [DataField("prototype", customTypeSerializer: typeof(PrototypeIdSerializer<EntityPrototype>))]
public string? Prototype { get; } public string? Prototype { get; }
[ViewVariables]
[DataField("ignoreDistance")]
public bool IgnoreDistance { get; }
[ViewVariables] [ViewVariables]
[DataField("doAfter")] [DataField("doAfter")]
public float DoAfterTime = 0; public float DoAfterTime = 0;

View File

@@ -25,6 +25,8 @@ namespace Content.Server.Engineering.EntitySystems
private async void HandleAfterInteract(EntityUid uid, SpawnAfterInteractComponent component, AfterInteractEvent args) private async void HandleAfterInteract(EntityUid uid, SpawnAfterInteractComponent component, AfterInteractEvent args)
{ {
if (!args.CanReach && !component.IgnoreDistance)
return;
if (string.IsNullOrEmpty(component.Prototype)) if (string.IsNullOrEmpty(component.Prototype))
return; return;
if (!_mapManager.TryGetGrid(args.ClickLocation.GetGridId(EntityManager), out var grid)) if (!_mapManager.TryGetGrid(args.ClickLocation.GetGridId(EntityManager), out var grid))