Fix device networking, again (#23035)
This commit is contained in:
@@ -92,7 +92,8 @@ public sealed class DeviceListSystem : SharedDeviceListSystem
|
|||||||
//Don't filter anything if the device list is empty
|
//Don't filter anything if the device list is empty
|
||||||
if (component.Devices.Count == 0)
|
if (component.Devices.Count == 0)
|
||||||
{
|
{
|
||||||
if (component.IsAllowList) args.Cancel();
|
if (component.IsAllowList)
|
||||||
|
args.Cancel();
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -100,7 +101,8 @@ public sealed class DeviceListSystem : SharedDeviceListSystem
|
|||||||
|
|
||||||
foreach (var recipient in args.Recipients)
|
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;
|
args.ModifiedRecipients = filteredRecipients;
|
||||||
@@ -162,7 +164,7 @@ public sealed class DeviceListSystem : SharedDeviceListSystem
|
|||||||
var old = device.Devices.ToList();
|
var old = device.Devices.ToList();
|
||||||
device.Devices.ExceptWith(toRemove);
|
device.Devices.ExceptWith(toRemove);
|
||||||
RaiseLocalEvent(uid, new DeviceListUpdateEvent(old, device.Devices.ToList()));
|
RaiseLocalEvent(uid, new DeviceListUpdateEvent(old, device.Devices.ToList()));
|
||||||
Dirty(device);
|
Dirty(uid, device);
|
||||||
toRemove.Clear();
|
toRemove.Clear();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -532,12 +532,13 @@ public sealed class NetworkConfiguratorSystem : SharedNetworkConfiguratorSystem
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
private void OnUiClosed(EntityUid uid, NetworkConfiguratorComponent component, BoundUIClosedEvent args)
|
private void OnUiClosed(EntityUid uid, NetworkConfiguratorComponent component, BoundUIClosedEvent args)
|
||||||
{
|
{
|
||||||
component.ActiveDeviceList = null;
|
|
||||||
if (TryComp(component.ActiveDeviceList, out DeviceListComponent? list))
|
if (TryComp(component.ActiveDeviceList, out DeviceListComponent? list))
|
||||||
{
|
{
|
||||||
list.Configurators.Remove(uid);
|
list.Configurators.Remove(uid);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
component.ActiveDeviceList = null;
|
||||||
|
|
||||||
if (args.UiKey is NetworkConfiguratorUiKey.Link)
|
if (args.UiKey is NetworkConfiguratorUiKey.Link)
|
||||||
{
|
{
|
||||||
component.ActiveDeviceLink = null;
|
component.ActiveDeviceLink = null;
|
||||||
|
|||||||
Reference in New Issue
Block a user