]> git.smokeofanarchy.ru Git - space-station-14.git/commitdiff
Fix client-side replay error (#27332)
authorLeon Friedrich <60421075+ElectroJr@users.noreply.github.com>
Fri, 26 Apr 2024 07:30:03 +0000 (19:30 +1200)
committerGitHub <noreply@github.com>
Fri, 26 Apr 2024 07:30:03 +0000 (17:30 +1000)
Content.Client/Replay/Spectator/ReplaySpectatorSystem.Position.cs
Content.Client/UserInterface/Systems/Alerts/Controls/AlertControl.cs
Content.Client/UserInterface/Systems/Alerts/Widgets/AlertsUI.xaml.cs

index 2ee7e30ec9a239e5d32021c912fd633743f16459..24f0e8a1d34035bd777889f6c3abe7fa719f4640 100644 (file)
@@ -198,6 +198,13 @@ public sealed partial class ReplaySpectatorSystem
         if (args.Transform.MapUid != null || args.OldMapId == MapId.Nullspace)
             return;
 
+        if (_spectatorData != null)
+        {
+            // Currently scrubbing/setting the replay tick
+            // the observer will get respawned once the state was applied
+            return;
+        }
+
         // The entity being spectated from was moved to null-space.
         // This was probably because they were spectating some entity in a client-side replay that left PVS range.
         // Simple respawn the ghost.
index 9423f7288df5beb40640329d01f280da9407b06c..af93033a9d3a8664736ebcae736d171aabc3a11c 100644 (file)
@@ -117,8 +117,7 @@ namespace Content.Client.UserInterface.Systems.Alerts.Controls
         protected override void Dispose(bool disposing)
         {
             base.Dispose(disposing);
-
-            _entityManager.DeleteEntity(_spriteViewEntity);
+            _entityManager.QueueDeleteEntity(_spriteViewEntity);
         }
     }
 
index 189de5040796942c6ed288043d6f264f7559590b..a1a494c47b3301d8b8b195d0cf0186e0ca95fc70 100644 (file)
@@ -97,7 +97,8 @@ public sealed partial class AlertsUI : UIWidget
             }
             else
             {
-                if (existingAlertControl != null) AlertContainer.Children.Remove(existingAlertControl);
+                if (existingAlertControl != null)
+                    AlertContainer.Children.Remove(existingAlertControl);
 
                 // this is a new alert + alert key or just a different alert with the same
                 // key, create the control and add it in the appropriate order