diff --git a/Content.Client/Gateway/UI/GatewayBoundUserInterface.cs b/Content.Client/Gateway/UI/GatewayBoundUserInterface.cs index 53b23272d4..78e0060e9c 100644 --- a/Content.Client/Gateway/UI/GatewayBoundUserInterface.cs +++ b/Content.Client/Gateway/UI/GatewayBoundUserInterface.cs @@ -20,7 +20,7 @@ public sealed class GatewayBoundUserInterface : BoundUserInterface _window = new GatewayWindow(); _window.OpenPortal += destination => { - SendMessage(new GatewayOpenPortalMessage(EntMan.GetNetEntity(destination))); + SendMessage(new GatewayOpenPortalMessage(destination)); }; _window.OnClose += Close; _window?.OpenCentered(); @@ -29,8 +29,11 @@ public sealed class GatewayBoundUserInterface : BoundUserInterface protected override void Dispose(bool disposing) { base.Dispose(disposing); - _window?.Dispose(); - _window = null; + if (disposing) + { + _window?.Dispose(); + _window = null; + } } protected override void UpdateState(BoundUserInterfaceState state) diff --git a/Content.Client/Gateway/UI/GatewayWindow.xaml.cs b/Content.Client/Gateway/UI/GatewayWindow.xaml.cs index c20b5e1a70..00293065dc 100644 --- a/Content.Client/Gateway/UI/GatewayWindow.xaml.cs +++ b/Content.Client/Gateway/UI/GatewayWindow.xaml.cs @@ -16,12 +16,11 @@ namespace Content.Client.Gateway.UI; public sealed partial class GatewayWindow : FancyWindow, IComputerWindow { - private readonly IEntityManager _entManager; private readonly IGameTiming _timing; - public event Action? OpenPortal; + public event Action? OpenPortal; private List<(NetEntity, string, TimeSpan, bool)> _destinations = default!; - private EntityUid? _current; + private NetEntity? _current; private TimeSpan _nextClose; private TimeSpan _lastOpen; private List