Inflatable wall fix (#8409)
* adds a check for canreach in SpawnAfterInteract * adds a check for the new field
This commit is contained in:
@@ -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;
|
||||||
|
|||||||
@@ -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))
|
||||||
|
|||||||
Reference in New Issue
Block a user