From: Leon Friedrich <60421075+ElectroJr@users.noreply.github.com> Date: Fri, 26 Apr 2024 07:30:03 +0000 (+1200) Subject: Fix client-side replay error (#27332) X-Git-Url: https://git.smokeofanarchy.ru/gitweb.cgi?a=commitdiff_plain;h=0ae942101a9f79ff49c3ffb3bfe257daa76719ff;p=space-station-14.git Fix client-side replay error (#27332) --- diff --git a/Content.Client/Replay/Spectator/ReplaySpectatorSystem.Position.cs b/Content.Client/Replay/Spectator/ReplaySpectatorSystem.Position.cs index 2ee7e30ec9..24f0e8a1d3 100644 --- a/Content.Client/Replay/Spectator/ReplaySpectatorSystem.Position.cs +++ b/Content.Client/Replay/Spectator/ReplaySpectatorSystem.Position.cs @@ -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. diff --git a/Content.Client/UserInterface/Systems/Alerts/Controls/AlertControl.cs b/Content.Client/UserInterface/Systems/Alerts/Controls/AlertControl.cs index 9423f7288d..af93033a9d 100644 --- a/Content.Client/UserInterface/Systems/Alerts/Controls/AlertControl.cs +++ b/Content.Client/UserInterface/Systems/Alerts/Controls/AlertControl.cs @@ -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); } } diff --git a/Content.Client/UserInterface/Systems/Alerts/Widgets/AlertsUI.xaml.cs b/Content.Client/UserInterface/Systems/Alerts/Widgets/AlertsUI.xaml.cs index 189de50407..a1a494c47b 100644 --- a/Content.Client/UserInterface/Systems/Alerts/Widgets/AlertsUI.xaml.cs +++ b/Content.Client/UserInterface/Systems/Alerts/Widgets/AlertsUI.xaml.cs @@ -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