]> git.smokeofanarchy.ru Git - space-station-14.git/commitdiff
Fix device networking, again (#23035)
authorLeon Friedrich <60421075+ElectroJr@users.noreply.github.com>
Wed, 27 Dec 2023 04:39:04 +0000 (23:39 -0500)
committerGitHub <noreply@github.com>
Wed, 27 Dec 2023 04:39:04 +0000 (21:39 -0700)
Content.Server/DeviceNetwork/Systems/DeviceListSystem.cs
Content.Server/DeviceNetwork/Systems/NetworkConfiguratorSystem.cs

index 66c1e3625436e5b00b29867a99d9cd91b86da42b..978dbc0ed931498e79640b051d10ca2dfe80c5fa 100644 (file)
@@ -92,7 +92,8 @@ public sealed class DeviceListSystem : SharedDeviceListSystem
         //Don't filter anything if the device list is empty
         if (component.Devices.Count == 0)
         {
-            if (component.IsAllowList) args.Cancel();
+            if (component.IsAllowList)
+                args.Cancel();
             return;
         }
 
@@ -100,7 +101,8 @@ public sealed class DeviceListSystem : SharedDeviceListSystem
 
         foreach (var recipient in args.Recipients)
         {
-            if (component.Devices.Contains(recipient.Owner) == component.IsAllowList) filteredRecipients.Add(recipient);
+            if (component.Devices.Contains(recipient.Owner) == component.IsAllowList)
+                filteredRecipients.Add(recipient);
         }
 
         args.ModifiedRecipients = filteredRecipients;
@@ -162,7 +164,7 @@ public sealed class DeviceListSystem : SharedDeviceListSystem
             var old = device.Devices.ToList();
             device.Devices.ExceptWith(toRemove);
             RaiseLocalEvent(uid, new DeviceListUpdateEvent(old, device.Devices.ToList()));
-            Dirty(device);
+            Dirty(uid, device);
             toRemove.Clear();
         }
     }
index fefe85ce8186421db05f67960e7bf6a0a3f82889..e610907d2575e7952111ec83f414d285dfea2475 100644 (file)
@@ -532,12 +532,13 @@ public sealed class NetworkConfiguratorSystem : SharedNetworkConfiguratorSystem
     /// </summary>
     private void OnUiClosed(EntityUid uid, NetworkConfiguratorComponent component, BoundUIClosedEvent args)
     {
-        component.ActiveDeviceList = null;
         if (TryComp(component.ActiveDeviceList, out DeviceListComponent? list))
         {
             list.Configurators.Remove(uid);
         }
 
+        component.ActiveDeviceList = null;
+
         if (args.UiKey is NetworkConfiguratorUiKey.Link)
         {
             component.ActiveDeviceLink = null;