From 626dfa05cda6dc6b11eabfdad86e97d9f3917e8d Mon Sep 17 00:00:00 2001 From: Flipp Syder <76629141+vulppine@users.noreply.github.com> Date: Sun, 26 Mar 2023 18:53:27 -0700 Subject: [PATCH] Adds arrivals blacklist (#14882) --- .../Shuttles/Components/ArrivalsBlacklistComponent.cs | 9 +++++++++ Content.Server/Shuttles/Systems/ArrivalsSystem.cs | 9 ++++++--- Resources/Prototypes/Entities/Objects/Devices/nuke.yml | 1 + .../Prototypes/Entities/Objects/Misc/dat_fukken_disk.yml | 1 + 4 files changed, 17 insertions(+), 3 deletions(-) create mode 100644 Content.Server/Shuttles/Components/ArrivalsBlacklistComponent.cs diff --git a/Content.Server/Shuttles/Components/ArrivalsBlacklistComponent.cs b/Content.Server/Shuttles/Components/ArrivalsBlacklistComponent.cs new file mode 100644 index 0000000000..838305a138 --- /dev/null +++ b/Content.Server/Shuttles/Components/ArrivalsBlacklistComponent.cs @@ -0,0 +1,9 @@ +namespace Content.Server.Shuttles.Components; + +/// +/// This is used for blacklisting entities from being on the arrivals shuttle when it goes FTL. +/// +[RegisterComponent] +public sealed class ArrivalsBlacklistComponent : Component +{ +} diff --git a/Content.Server/Shuttles/Systems/ArrivalsSystem.cs b/Content.Server/Shuttles/Systems/ArrivalsSystem.cs index cb7d0074be..2181014eb4 100644 --- a/Content.Server/Shuttles/Systems/ArrivalsSystem.cs +++ b/Content.Server/Shuttles/Systems/ArrivalsSystem.cs @@ -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(); + var arrivalsBlacklistQuery = GetEntityQuery(); var mobQuery = GetEntityQuery(); var xformQuery = GetEntityQuery(); - DumpChildren(uid, ref args, pendingEntQuery, mobQuery, xformQuery); + DumpChildren(uid, ref args, pendingEntQuery, arrivalsBlacklistQuery, mobQuery, xformQuery); } var pendingQuery = AllEntityQuery(); @@ -180,6 +182,7 @@ public sealed class ArrivalsSystem : EntitySystem private void DumpChildren(EntityUid uid, ref FTLStartedEvent args, EntityQuery pendingEntQuery, + EntityQuery arrivalsBlacklistQuery, EntityQuery mobQuery, EntityQuery 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); } } diff --git a/Resources/Prototypes/Entities/Objects/Devices/nuke.yml b/Resources/Prototypes/Entities/Objects/Devices/nuke.yml index bf8584d5ce..4a7111b64d 100644 --- a/Resources/Prototypes/Entities/Objects/Devices/nuke.yml +++ b/Resources/Prototypes/Entities/Objects/Devices/nuke.yml @@ -50,6 +50,7 @@ - type: StaticPrice price: 50000 # YOU STOLE A NUCLEAR FISSION EXPLOSIVE?! - type: CargoSellBlacklist + - type: ArrivalsBlacklist - type: ItemSlots - type: ContainerContainer containers: diff --git a/Resources/Prototypes/Entities/Objects/Misc/dat_fukken_disk.yml b/Resources/Prototypes/Entities/Objects/Misc/dat_fukken_disk.yml index 6b9e4e18dd..b0fe40562e 100644 --- a/Resources/Prototypes/Entities/Objects/Misc/dat_fukken_disk.yml +++ b/Resources/Prototypes/Entities/Objects/Misc/dat_fukken_disk.yml @@ -14,6 +14,7 @@ - type: StaticPrice price: 2000 - type: CargoSellBlacklist + - type: ArrivalsBlacklist - type: WarpPoint follow: true location: nuke disk -- 2.51.2