Goes in-game now
This commit is contained in:
@@ -116,6 +116,8 @@ namespace Content.Server.MachineLinking.System
|
||||
private void OnReceiverUIMessage(EntityUid uid, SignalReceiverComponent component,
|
||||
ServerBoundUserInterfaceMessage msg)
|
||||
{
|
||||
if (msg.Session.AttachedEntity is not { } attached) return;
|
||||
|
||||
switch (msg.Message)
|
||||
{
|
||||
case SignalPortSelected portSelected:
|
||||
@@ -123,12 +125,12 @@ namespace Content.Server.MachineLinking.System
|
||||
!EntityManager.TryGetComponent(msg.Session.AttachedEntity, out HandsComponent? hands) ||
|
||||
!hands.TryGetActiveHeldEntity(out var heldEntity) ||
|
||||
!EntityManager.TryGetComponent(heldEntity, out SignalLinkerComponent? signalLinkerComponent) ||
|
||||
!_interaction.InRangeUnobstructed(msg.Session.AttachedEntity, component.Owner, ignoreInsideBlocker: true) ||
|
||||
!_interaction.InRangeUnobstructed(attached, component.Owner, ignoreInsideBlocker: true) ||
|
||||
!signalLinkerComponent.Port.HasValue ||
|
||||
!signalLinkerComponent.Port.Value.transmitter.Outputs.ContainsPort(signalLinkerComponent.Port
|
||||
.Value.port) || !component.Inputs.ContainsPort(portSelected.Port))
|
||||
return;
|
||||
LinkerInteraction(msg.Session.AttachedEntity, signalLinkerComponent.Port.Value.transmitter,
|
||||
LinkerInteraction(attached, signalLinkerComponent.Port.Value.transmitter,
|
||||
signalLinkerComponent.Port.Value.port, component, portSelected.Port);
|
||||
break;
|
||||
}
|
||||
@@ -156,6 +158,9 @@ namespace Content.Server.MachineLinking.System
|
||||
private void OnTransmitterUIMessage(EntityUid uid, SignalTransmitterComponent component,
|
||||
ServerBoundUserInterfaceMessage msg)
|
||||
{
|
||||
if (msg.Session.AttachedEntity is not { } attached)
|
||||
return;
|
||||
|
||||
switch (msg.Message)
|
||||
{
|
||||
case SignalPortSelected portSelected:
|
||||
@@ -163,9 +168,9 @@ namespace Content.Server.MachineLinking.System
|
||||
!EntityManager.TryGetComponent(msg.Session.AttachedEntity, out HandsComponent? hands) ||
|
||||
!hands.TryGetActiveHeldEntity(out var heldEntity) ||
|
||||
!EntityManager.TryGetComponent(heldEntity, out SignalLinkerComponent? signalLinkerComponent) ||
|
||||
!_interaction.InRangeUnobstructed(msg.Session.AttachedEntity, component.Owner, ignoreInsideBlocker: true))
|
||||
!_interaction.InRangeUnobstructed(attached, component.Owner, ignoreInsideBlocker: true))
|
||||
return;
|
||||
LinkerSaveInteraction(msg.Session.AttachedEntity, signalLinkerComponent, component,
|
||||
LinkerSaveInteraction(attached, signalLinkerComponent, component,
|
||||
portSelected.Port);
|
||||
break;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user