]> git.smokeofanarchy.ru Git - space-station-14.git/commitdiff
Adds arrivals blacklist (#14882)
authorFlipp Syder <76629141+vulppine@users.noreply.github.com>
Mon, 27 Mar 2023 01:53:27 +0000 (18:53 -0700)
committerGitHub <noreply@github.com>
Mon, 27 Mar 2023 01:53:27 +0000 (12:53 +1100)
Content.Server/Shuttles/Components/ArrivalsBlacklistComponent.cs [new file with mode: 0644]
Content.Server/Shuttles/Systems/ArrivalsSystem.cs
Resources/Prototypes/Entities/Objects/Devices/nuke.yml
Resources/Prototypes/Entities/Objects/Misc/dat_fukken_disk.yml

diff --git a/Content.Server/Shuttles/Components/ArrivalsBlacklistComponent.cs b/Content.Server/Shuttles/Components/ArrivalsBlacklistComponent.cs
new file mode 100644 (file)
index 0000000..838305a
--- /dev/null
@@ -0,0 +1,9 @@
+namespace Content.Server.Shuttles.Components;
+
+/// <summary>
+/// This is used for blacklisting entities from being on the arrivals shuttle when it goes FTL.
+/// </summary>
+[RegisterComponent]
+public sealed class ArrivalsBlacklistComponent : Component
+{
+}
index cb7d0074be651b8b11cf9a5c7180836b808d164a..2181014eb4e6fe204a429731ecc086479fee7abb 100644 (file)
@@ -14,6 +14,7 @@ using Content.Shared.CCVar;
 using Content.Shared.Mobs.Components;
 using Content.Shared.Shuttles.Components;
 using Content.Shared.Spawners.Components;
+using Content.Shared.Tag;
 using Content.Shared.Tiles;
 using Robust.Server.GameObjects;
 using Robust.Shared.Configuration;
@@ -159,9 +160,10 @@ public sealed class ArrivalsSystem : EntitySystem
         if (!_cfgManager.GetCVar(CCVars.ArrivalsReturns) && args.FromMapUid != null)
         {
             var pendingEntQuery = GetEntityQuery<PendingClockInComponent>();
+            var arrivalsBlacklistQuery = GetEntityQuery<ArrivalsBlacklistComponent>();
             var mobQuery = GetEntityQuery<MobStateComponent>();
             var xformQuery = GetEntityQuery<TransformComponent>();
-            DumpChildren(uid, ref args, pendingEntQuery, mobQuery, xformQuery);
+            DumpChildren(uid, ref args, pendingEntQuery, arrivalsBlacklistQuery, mobQuery, xformQuery);
         }
 
         var pendingQuery = AllEntityQuery<PendingClockInComponent, TransformComponent>();
@@ -180,6 +182,7 @@ public sealed class ArrivalsSystem : EntitySystem
     private void DumpChildren(EntityUid uid,
         ref FTLStartedEvent args,
         EntityQuery<PendingClockInComponent> pendingEntQuery,
+        EntityQuery<ArrivalsBlacklistComponent> arrivalsBlacklistQuery,
         EntityQuery<MobStateComponent> mobQuery,
         EntityQuery<TransformComponent> xformQuery)
     {
@@ -188,7 +191,7 @@ public sealed class ArrivalsSystem : EntitySystem
 
         var xform = xformQuery.GetComponent(uid);
 
-        if (mobQuery.HasComponent(uid))
+        if (mobQuery.HasComponent(uid) || arrivalsBlacklistQuery.HasComponent(uid))
         {
             var rotation = xform.LocalRotation;
             _transform.SetCoordinates(uid, new EntityCoordinates(args.FromMapUid!.Value, args.FTLFrom.Transform(xform.LocalPosition)));
@@ -200,7 +203,7 @@ public sealed class ArrivalsSystem : EntitySystem
 
         while (children.MoveNext(out var child))
         {
-            DumpChildren(child.Value, ref args, pendingEntQuery, mobQuery, xformQuery);
+            DumpChildren(child.Value, ref args, pendingEntQuery, arrivalsBlacklistQuery, mobQuery, xformQuery);
         }
     }
 
index bf8584d5ce3af314aa65e99ca7b849bea67e254b..4a7111b64dc985fa54f1fa9543c207b4a65dd9a1 100644 (file)
@@ -50,6 +50,7 @@
   - type: StaticPrice
     price: 50000 # YOU STOLE A NUCLEAR FISSION EXPLOSIVE?!
   - type: CargoSellBlacklist
+  - type: ArrivalsBlacklist
   - type: ItemSlots
   - type: ContainerContainer
     containers:
index 6b9e4e18ddc9d499bed693d92413ab6d25572d01..b0fe40562ecc37099fd022907c359b7a3f7ae065 100644 (file)
@@ -14,6 +14,7 @@
   - type: StaticPrice
     price: 2000
   - type: CargoSellBlacklist
+  - type: ArrivalsBlacklist
   - type: WarpPoint
     follow: true
     location: nuke disk