]> git.smokeofanarchy.ru Git - space-station-14.git/commitdiff
Fix interlocking airlocks (#16265)
authorTyzemol <85772526+Tyzemol@users.noreply.github.com>
Tue, 9 May 2023 22:50:34 +0000 (03:50 +0500)
committerGitHub <noreply@github.com>
Tue, 9 May 2023 22:50:34 +0000 (18:50 -0400)
Content.Server/DeviceNetwork/Systems/NetworkConfiguratorSystem.cs

index dd29e8e2e33f398a97623b3722b41e68cc7124ef..a661fbd70b348f9c69461c9516a30365e37a5a29 100644 (file)
@@ -148,17 +148,19 @@ public sealed class NetworkConfiguratorSystem : SharedNetworkConfiguratorSystem
             return;
         }
 
-        if (HasComp<DeviceLinkSourceComponent>(target) && HasComp<DeviceLinkSourceComponent>(configurator.ActiveDeviceLink)
-            || HasComp<DeviceLinkSinkComponent>(target) && HasComp<DeviceLinkSinkComponent>(configurator.ActiveDeviceLink))
+        if (configurator.ActiveDeviceLink.HasValue
+            && (HasComp<DeviceLinkSourceComponent>(target)
+            && HasComp<DeviceLinkSinkComponent>(configurator.ActiveDeviceLink)
+            || HasComp<DeviceLinkSinkComponent>(target)
+            && HasComp<DeviceLinkSourceComponent>(configurator.ActiveDeviceLink)))
         {
+            OpenDeviceLinkUi(uid, target, user, configurator);
             return;
         }
 
-        if (configurator.ActiveDeviceLink.HasValue)
-        {
-            OpenDeviceLinkUi( uid, target, user, configurator);
+        if (HasComp<DeviceLinkSourceComponent>(target) && HasComp<DeviceLinkSourceComponent>(configurator.ActiveDeviceLink)
+            || HasComp<DeviceLinkSinkComponent>(target) && HasComp<DeviceLinkSinkComponent>(configurator.ActiveDeviceLink))
             return;
-        }
 
         _popupSystem.PopupEntity(Loc.GetString("network-configurator-link-mode-started",  ("device", Name(target.Value))), target.Value, user);
         configurator.ActiveDeviceLink = target;