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.Mobs.Components;
using Content.Shared.Shuttles.Components; using Content.Shared.Shuttles.Components;
using Content.Shared.Spawners.Components; using Content.Shared.Spawners.Components;
using Content.Shared.Tag;
using Content.Shared.Tiles; using Content.Shared.Tiles;
using Robust.Server.GameObjects; using Robust.Server.GameObjects;
using Robust.Shared.Configuration; using Robust.Shared.Configuration;
@@ -159,9 +160,10 @@ public sealed class ArrivalsSystem : EntitySystem
if (!_cfgManager.GetCVar(CCVars.ArrivalsReturns) && args.FromMapUid != null) if (!_cfgManager.GetCVar(CCVars.ArrivalsReturns) && args.FromMapUid != null)
{ {
var pendingEntQuery = GetEntityQuery<PendingClockInComponent>(); var pendingEntQuery = GetEntityQuery<PendingClockInComponent>();
var arrivalsBlacklistQuery = GetEntityQuery<ArrivalsBlacklistComponent>();
var mobQuery = GetEntityQuery<MobStateComponent>(); var mobQuery = GetEntityQuery<MobStateComponent>();
var xformQuery = GetEntityQuery<TransformComponent>(); var xformQuery = GetEntityQuery<TransformComponent>();
DumpChildren(uid, ref args, pendingEntQuery, mobQuery, xformQuery); DumpChildren(uid, ref args, pendingEntQuery, arrivalsBlacklistQuery, mobQuery, xformQuery);
} }
var pendingQuery = AllEntityQuery<PendingClockInComponent, TransformComponent>(); var pendingQuery = AllEntityQuery<PendingClockInComponent, TransformComponent>();
@@ -180,6 +182,7 @@ public sealed class ArrivalsSystem : EntitySystem
private void DumpChildren(EntityUid uid, private void DumpChildren(EntityUid uid,
ref FTLStartedEvent args, ref FTLStartedEvent args,
EntityQuery<PendingClockInComponent> pendingEntQuery, EntityQuery<PendingClockInComponent> pendingEntQuery,
EntityQuery<ArrivalsBlacklistComponent> arrivalsBlacklistQuery,
EntityQuery<MobStateComponent> mobQuery, EntityQuery<MobStateComponent> mobQuery,
EntityQuery<TransformComponent> xformQuery) EntityQuery<TransformComponent> xformQuery)
{ {
@@ -188,7 +191,7 @@ public sealed class ArrivalsSystem : EntitySystem
var xform = xformQuery.GetComponent(uid); var xform = xformQuery.GetComponent(uid);
if (mobQuery.HasComponent(uid)) if (mobQuery.HasComponent(uid) || arrivalsBlacklistQuery.HasComponent(uid))
{ {
var rotation = xform.LocalRotation; var rotation = xform.LocalRotation;
_transform.SetCoordinates(uid, new EntityCoordinates(args.FromMapUid!.Value, args.FTLFrom.Transform(xform.LocalPosition))); _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)) 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 - type: StaticPrice
price: 50000 # YOU STOLE A NUCLEAR FISSION EXPLOSIVE?! price: 50000 # YOU STOLE A NUCLEAR FISSION EXPLOSIVE?!
- type: CargoSellBlacklist - type: CargoSellBlacklist
- type: ArrivalsBlacklist
- type: ItemSlots - type: ItemSlots
- type: ContainerContainer - type: ContainerContainer
containers: containers:

View File

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