From 8aba52d7965c062d244fd98e20e0e64910e6cef2 Mon Sep 17 00:00:00 2001 From: deltanedas <39013340+deltanedas@users.noreply.github.com> Date: Sat, 16 Sep 2023 06:56:35 +0100 Subject: [PATCH] fix gateway destinations (#20172) Co-authored-by: deltanedas <@deltanedas:kde.org> --- .../Gateway/UI/GatewayBoundUserInterface.cs | 9 ++++++--- Content.Client/Gateway/UI/GatewayWindow.xaml.cs | 16 +++++++--------- .../Gateway/Components/GatewayComponent.cs | 2 +- Content.Server/Gateway/Systems/GatewaySystem.cs | 12 +++++++++++- 4 files changed, 25 insertions(+), 14 deletions(-) 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