Adds arrivals blacklist (#14882)

This commit is contained in:
Flipp Syder
2023-03-26 18:53:27 -07:00
committed by GitHub
parent 018ba85885
commit 626dfa05cd
4 changed files with 17 additions and 3 deletions

View File

@@ -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
{
}

View 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);
}
}

View File

@@ -50,6 +50,7 @@
- type: StaticPrice
price: 50000 # YOU STOLE A NUCLEAR FISSION EXPLOSIVE?!
- type: CargoSellBlacklist
- type: ArrivalsBlacklist
- type: ItemSlots
- type: ContainerContainer
containers:

View File

@@ -14,6 +14,7 @@
- type: StaticPrice
price: 2000
- type: CargoSellBlacklist
- type: ArrivalsBlacklist
- type: WarpPoint
follow: true
location: nuke disk