From: deltanedas <39013340+deltanedas@users.noreply.github.com> Date: Sat, 16 Sep 2023 05:56:35 +0000 (+0100) Subject: fix gateway destinations (#20172) X-Git-Url: https://git.smokeofanarchy.ru/gitweb.cgi?a=commitdiff_plain;h=8aba52d7965c062d244fd98e20e0e64910e6cef2;p=space-station-14.git fix gateway destinations (#20172) Co-authored-by: deltanedas <@deltanedas:kde.org> --- 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