]> git.smokeofanarchy.ru Git - space-station-14.git/commitdiff
Fix ghost warps (#20008)
authormetalgearsloth <31366439+metalgearsloth@users.noreply.github.com>
Mon, 11 Sep 2023 05:43:24 +0000 (15:43 +1000)
committerGitHub <noreply@github.com>
Mon, 11 Sep 2023 05:43:24 +0000 (15:43 +1000)
Content.Client/UserInterface/Systems/Ghost/Controls/GhostTargetWindow.xaml.cs
Content.Client/UserInterface/Systems/Ghost/GhostUIController.cs

index 1417b4777178f8605671933578235e15c4a27e92..3d86266df81b90a457eab560d49238b97c812e5d 100644 (file)
@@ -11,16 +11,16 @@ namespace Content.Client.UserInterface.Systems.Ghost.Controls
     [GenerateTypedNameReferences]
     public sealed partial class GhostTargetWindow : DefaultWindow
     {
-        private List<(string, EntityUid)> _warps = new();
+        private List<(string, NetEntity)> _warps = new();
 
-        public event Action<EntityUid>? WarpClicked;
+        public event Action<NetEntity>? WarpClicked;
 
         public GhostTargetWindow()
         {
             RobustXamlLoader.Load(this);
         }
 
-        public void UpdateWarps(IEnumerable<GhostWarp> warps, IEntityManager entManager)
+        public void UpdateWarps(IEnumerable<GhostWarp> warps)
         {
             // Server COULD send these sorted but how about we just use the client to do it instead
             _warps = warps
@@ -33,7 +33,7 @@ namespace Content.Client.UserInterface.Systems.Ghost.Controls
                         ? Loc.GetString("ghost-target-window-current-button", ("name", w.DisplayName))
                         : w.DisplayName;
 
-                    return (name, entManager.GetEntity(w.Entity));
+                    return (name, w.Entity);
                 })
                 .ToList();
         }
index 709b7c553c7c8f22e0c7ccc93fa649cacbf5feba..12d6c659530ba5d200006c525e0881f231b572e9 100644 (file)
@@ -96,7 +96,7 @@ public sealed class GhostUIController : UIController, IOnSystemChanged<GhostSyst
         if (Gui?.TargetWindow is not { } window)
             return;
 
-        window.UpdateWarps(msg.Warps, EntityManager);
+        window.UpdateWarps(msg.Warps);
         window.Populate();
     }
 
@@ -105,9 +105,9 @@ public sealed class GhostUIController : UIController, IOnSystemChanged<GhostSyst
         UpdateGui();
     }
 
-    private void OnWarpClicked(EntityUid player)
+    private void OnWarpClicked(NetEntity player)
     {
-        var msg = new GhostWarpToTargetRequestEvent(EntityManager.GetNetEntity(player));
+        var msg = new GhostWarpToTargetRequestEvent(player);
         _net.SendSystemNetworkMessage(msg);
     }