diff --git a/Content.Server/Administration/AGhost.cs b/Content.Server/Administration/AGhost.cs index 40547197e1..f4eb9fca29 100644 --- a/Content.Server/Administration/AGhost.cs +++ b/Content.Server/Administration/AGhost.cs @@ -1,10 +1,12 @@ -using Content.Server.GameObjects.Components.Observer; +using System.Timers; +using Content.Server.GameObjects.Components.Observer; using Content.Server.Players; using Robust.Server.Interfaces.Console; using Robust.Server.Interfaces.Player; using Robust.Shared.Interfaces.GameObjects; using Robust.Shared.IoC; using Robust.Shared.Map; +using Timer = Robust.Shared.Timers.Timer; namespace Content.Server.Administration { @@ -27,7 +29,7 @@ namespace Content.Server.Administration { var visiting = mind.VisitingEntity; mind.UnVisit(); - visiting.Delete(); + Timer.Spawn(100, visiting.Delete); } else { diff --git a/Content.Server/GameObjects/Components/Observer/GhostComponent.cs b/Content.Server/GameObjects/Components/Observer/GhostComponent.cs index 6adc21ed33..a829ad5987 100644 --- a/Content.Server/GameObjects/Components/Observer/GhostComponent.cs +++ b/Content.Server/GameObjects/Components/Observer/GhostComponent.cs @@ -50,6 +50,7 @@ namespace Content.Server.GameObjects.Components.Observer if (netChannel == null || netChannel == actor.playerSession.ConnectedClient) { actor.playerSession.ContentData().Mind.UnVisit(); + Timer.Spawn(100, Owner.Delete); } break; case PlayerAttachedMsg msg: @@ -58,7 +59,6 @@ namespace Content.Server.GameObjects.Components.Observer break; case PlayerDetachedMsg msg: msg.OldPlayer.VisibilityMask &= ~(int)VisibilityFlags.Ghost; - Timer.Spawn(100, Owner.Delete); break; default: break; diff --git a/Content.Server/Observer/Ghost.cs b/Content.Server/Observer/Ghost.cs index 712d673c5a..c87581f3d3 100644 --- a/Content.Server/Observer/Ghost.cs +++ b/Content.Server/Observer/Ghost.cs @@ -10,6 +10,7 @@ using Robust.Shared.Interfaces.GameObjects; using Robust.Shared.IoC; using Robust.Shared.Log; using Robust.Shared.Map; +using Robust.Shared.Timers; namespace Content.Server.Observer { @@ -37,6 +38,7 @@ namespace Content.Server.Observer if (mind.VisitingEntity != null) { mind.UnVisit(); + Timer.Spawn(100, mind.VisitingEntity.Delete); } var position = player.AttachedEntity?.Transform.GridPosition ?? IoCManager.Resolve().GetObserverSpawnPoint();