diff --git a/Content.Server/GameObjects/Components/Singularity/SingularityComponent.cs b/Content.Server/GameObjects/Components/Singularity/SingularityComponent.cs index a84fad68ac..a21601b660 100644 --- a/Content.Server/GameObjects/Components/Singularity/SingularityComponent.cs +++ b/Content.Server/GameObjects/Components/Singularity/SingularityComponent.cs @@ -2,6 +2,7 @@ using System.Collections.Generic; using System.Linq; using Content.Server.GameObjects.Components.StationEvents; +using Content.Server.GameObjects.Components.Observer; using Content.Shared.GameObjects; using Content.Shared.Physics; using Robust.Server.GameObjects; @@ -159,7 +160,7 @@ namespace Content.Server.GameObjects.Components.Singularity } private readonly List _previousPulledEntities = new(); - public void PullUpdate() + public void CleanupPulledEntities() { foreach (var previousPulledEntity in _previousPulledEntities) { @@ -169,11 +170,16 @@ namespace Content.Server.GameObjects.Components.Singularity controller.StopPull(); } _previousPulledEntities.Clear(); + } + public void PullUpdate() + { + CleanupPulledEntities(); var entitiesToPull = Owner.EntityManager.GetEntitiesInRange(Owner.Transform.Coordinates, Level * 10); foreach (var entity in entitiesToPull) { if (!entity.TryGetComponent(out var collidableComponent)) continue; + if (entity.HasComponent()) continue; var controller = collidableComponent.EnsureController(); if(Owner.Transform.Coordinates.EntityId != entity.Transform.Coordinates.EntityId) continue; var vec = (Owner.Transform.Coordinates - entity.Transform.Coordinates).Position; @@ -215,6 +221,7 @@ namespace Content.Server.GameObjects.Components.Singularity { _playingSound?.Stop(); _audioSystem.PlayAtCoords("/Audio/Effects/singularity_collapse.ogg", Owner.Transform.Coordinates); + CleanupPulledEntities(); base.OnRemove(); } }