Server/MachineLinking: allow linking devices that are inside obstructions (#5010)

...like signal buttons/switches on a wall.
This commit is contained in:
E F R
2021-10-24 08:21:39 +00:00
committed by GitHub
parent a8be25ca33
commit 3c0473dfe4

View File

@@ -123,7 +123,7 @@ namespace Content.Server.MachineLinking.System
!msg.Session.AttachedEntity.TryGetComponent(out HandsComponent? hands) ||
!hands.TryGetActiveHeldEntity(out var heldEntity) ||
!heldEntity.TryGetComponent(out SignalLinkerComponent? signalLinkerComponent) ||
!_interaction.InRangeUnobstructed(msg.Session.AttachedEntity, component.Owner) ||
!_interaction.InRangeUnobstructed(msg.Session.AttachedEntity, component.Owner, ignoreInsideBlocker: true) ||
!signalLinkerComponent.Port.HasValue ||
!signalLinkerComponent.Port.Value.transmitter.Outputs.ContainsPort(signalLinkerComponent.Port
.Value.port) || !component.Inputs.ContainsPort(portSelected.Port))
@@ -163,7 +163,7 @@ namespace Content.Server.MachineLinking.System
!msg.Session.AttachedEntity.TryGetComponent(out HandsComponent? hands) ||
!hands.TryGetActiveHeldEntity(out var heldEntity) ||
!heldEntity.TryGetComponent(out SignalLinkerComponent? signalLinkerComponent) ||
!_interaction.InRangeUnobstructed(msg.Session.AttachedEntity, component.Owner))
!_interaction.InRangeUnobstructed(msg.Session.AttachedEntity, component.Owner, ignoreInsideBlocker: true))
return;
LinkerSaveInteraction(msg.Session.AttachedEntity, signalLinkerComponent, component,
portSelected.Port);