using Content.Server.Station.Systems;
using Content.Shared.Administration;
using Content.Shared.CCVar;
+using Content.Shared.Mobs.Components;
using Content.Shared.Shuttles.Components;
using Content.Shared.Spawners.Components;
using Content.Shared.Tiles;
private void OnArrivalsFTL(EntityUid uid, ArrivalsShuttleComponent component, ref FTLStartedEvent args)
{
- // Anyone already clocked in yeet them off the shuttle.
+ // Any mob then yeet them off the shuttle.
if (!_cfgManager.GetCVar(CCVars.ArrivalsReturns) && args.FromMapUid != null)
{
- var clockedQuery = AllEntityQuery<ClockedInComponent, TransformComponent>();
-
- // Clock them in when they FTL
- while (clockedQuery.MoveNext(out var cUid, out _, out var xform))
- {
- if (xform.GridUid != uid)
- continue;
-
- var rotation = xform.LocalRotation;
- _transform.SetCoordinates(cUid, new EntityCoordinates(args.FromMapUid.Value, args.FTLFrom.Transform(xform.LocalPosition)));
- _transform.SetWorldRotation(cUid, args.FromRotation + rotation);
- }
+ var pendingEntQuery = GetEntityQuery<PendingClockInComponent>();
+ var mobQuery = GetEntityQuery<MobStateComponent>();
+ var xformQuery = GetEntityQuery<TransformComponent>();
+ DumpChildren(uid, ref args, pendingEntQuery, mobQuery, xformQuery);
}
var pendingQuery = AllEntityQuery<PendingClockInComponent, TransformComponent>();
// Clock them in when they FTL
while (pendingQuery.MoveNext(out var pUid, out _, out var xform))
{
+ // Cheaper to iterate pending arrivals than all children
if (xform.GridUid != uid)
continue;
- EnsureComp<ClockedInComponent>(pUid);
+ RemCompDeferred<PendingClockInComponent>(pUid);
+ }
+ }
+
+ private void DumpChildren(EntityUid uid,
+ ref FTLStartedEvent args,
+ EntityQuery<PendingClockInComponent> pendingEntQuery,
+ EntityQuery<MobStateComponent> mobQuery,
+ EntityQuery<TransformComponent> xformQuery)
+ {
+ if (pendingEntQuery.HasComponent(uid))
+ return;
+
+ var xform = xformQuery.GetComponent(uid);
+
+ if (mobQuery.HasComponent(uid))
+ {
+ var rotation = xform.LocalRotation;
+ _transform.SetCoordinates(uid, new EntityCoordinates(args.FromMapUid!.Value, args.FTLFrom.Transform(xform.LocalPosition)));
+ _transform.SetWorldRotation(uid, args.FromRotation + rotation);
+ return;
+ }
+
+ var children = xform.ChildEnumerator;
+
+ while (children.MoveNext(out var child))
+ {
+ DumpChildren(child.Value, ref args, pendingEntQuery, mobQuery, xformQuery);
}
}
- Do not intentionally make other players' lives hell for your own amusement.
- Antagonists have lots of leeway with this rule and may kill/sabotage as they see fit, but if it degrades the experience for majority of the rest of the server you will be told to stop.
- [color=#ff0000]THE ROUND IS NOT OVER UNTIL THE END-ROUND SUMMARY APPEARS. KILLING SOMEONE FOR NO REASON BEFORE THIS WILL BE HANDLED ACCORDINGLY.[/color]
+ - Do not grief / spawnkill players on the arrivals station, arrivals shuttle, or other newly spawned areas. This applies if you are an antagonist.
[color=#a4885c]12.[/color] Don't harass or target players across rounds for actions in prior rounds or for actions outside of the game (this is referred to as "Metagrudging".)
- Annoying players for IC reasons in the current round is fine; doing it across rounds or as a ghost role after they kill you is not.