]> git.smokeofanarchy.ru Git - space-station-14.git/commitdiff
Fix bluespace anomaly teleporting borg brains and PAIs in container slots (#30744)
authorslarticodefast <161409025+slarticodefast@users.noreply.github.com>
Sat, 17 Aug 2024 04:58:23 +0000 (06:58 +0200)
committerGitHub <noreply@github.com>
Sat, 17 Aug 2024 04:58:23 +0000 (00:58 -0400)
* Fix bluespace

* filter all containers

Content.Server/Anomaly/Effects/BluespaceAnomalySystem.cs

index bd8c2f3c7dee7f37b8cee2593b7e6b4301f8a2a4..be56f9684509de87ad476234043d0a3313914c88 100644 (file)
@@ -6,7 +6,6 @@ using Content.Shared.Anomaly.Components;
 using Content.Shared.Database;
 using Content.Shared.Mobs.Components;
 using Content.Shared.Teleportation.Components;
-using Robust.Shared.Audio;
 using Robust.Shared.Audio.Systems;
 using Robust.Shared.Collections;
 using Robust.Shared.Random;
@@ -34,8 +33,11 @@ public sealed class BluespaceAnomalySystem : EntitySystem
         var xformQuery = GetEntityQuery<TransformComponent>();
         var xform = xformQuery.GetComponent(uid);
         var range = component.MaxShuffleRadius * args.Severity * args.PowerModifier;
+        // get a list of all entities in range with the MobStateComponent
+        // we filter out those inside a container
+        // otherwise borg brains get removed from their body, or PAIs from a PDA
         var mobs = new HashSet<Entity<MobStateComponent>>();
-        _lookup.GetEntitiesInRange(xform.Coordinates, range, mobs);
+        _lookup.GetEntitiesInRange(xform.Coordinates, range, mobs, flags: LookupFlags.Uncontained);
         var allEnts = new ValueList<EntityUid>(mobs.Select(m => m.Owner)) { uid };
         var coords = new ValueList<Vector2>();
         foreach (var ent in allEnts)
@@ -59,7 +61,7 @@ public sealed class BluespaceAnomalySystem : EntitySystem
         var radius = component.SupercriticalTeleportRadius * args.PowerModifier;
         var gridBounds = new Box2(mapPos - new Vector2(radius, radius), mapPos + new Vector2(radius, radius));
         var mobs = new HashSet<Entity<MobStateComponent>>();
-        _lookup.GetEntitiesInRange(xform.Coordinates, component.MaxShuffleRadius, mobs);
+        _lookup.GetEntitiesInRange(xform.Coordinates, component.MaxShuffleRadius, mobs, flags: LookupFlags.Uncontained);
         foreach (var comp in mobs)
         {
             var ent = comp.Owner;