using System.Linq;
using Content.Server.Administration;
-using Content.Server.Chat.Managers;
using Content.Server.GameTicking;
using Content.Server.GameTicking.Events;
using Content.Server.Shuttles.Components;
using Content.Shared.Administration;
using Content.Shared.CCVar;
using Content.Shared.Mobs.Components;
+using Content.Shared.Movement.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;
using Robust.Shared.Map;
using Robust.Shared.Random;
using Robust.Shared.Timing;
-using Robust.Shared.Utility;
namespace Content.Server.Shuttles.Systems;
break;
}
+ RemCompDeferred<AutoOrientComponent>(uid);
RemCompDeferred<PendingClockInComponent>(uid);
shell.WriteLine(Loc.GetString("cmd-arrivals-forced", ("uid", ToPrettyString(uid))));
}
_cfgManager.UnsubValueChanged(CCVars.ArrivalsShuttles, SetArrivals);
}
- private void OnArrivalsFTL(EntityUid uid, ArrivalsShuttleComponent component, ref FTLStartedEvent args)
+ private void OnArrivalsFTL(EntityUid shuttleUid, ArrivalsShuttleComponent component, ref FTLStartedEvent args)
{
// Any mob then yeet them off the shuttle.
if (!_cfgManager.GetCVar(CCVars.ArrivalsReturns) && args.FromMapUid != null)
var arrivalsBlacklistQuery = GetEntityQuery<ArrivalsBlacklistComponent>();
var mobQuery = GetEntityQuery<MobStateComponent>();
var xformQuery = GetEntityQuery<TransformComponent>();
- DumpChildren(uid, ref args, pendingEntQuery, arrivalsBlacklistQuery, mobQuery, xformQuery);
+ DumpChildren(shuttleUid, ref args, pendingEntQuery, arrivalsBlacklistQuery, mobQuery, xformQuery);
}
var pendingQuery = AllEntityQuery<PendingClockInComponent, TransformComponent>();
while (pendingQuery.MoveNext(out var pUid, out _, out var xform))
{
// Cheaper to iterate pending arrivals than all children
- if (xform.GridUid != uid)
+ if (xform.GridUid != shuttleUid)
continue;
RemCompDeferred<PendingClockInComponent>(pUid);
+ RemCompDeferred<AutoOrientComponent>(pUid);
}
}
ev.Station);
EnsureComp<PendingClockInComponent>(ev.SpawnResult.Value);
+ EnsureComp<AutoOrientComponent>(ev.SpawnResult.Value);
return;
}
}
SubscribeLocalEvent<InputMoverComponent, ComponentHandleState>(OnInputHandleState);
SubscribeLocalEvent<InputMoverComponent, EntParentChangedMessage>(OnInputParentChange);
+ SubscribeLocalEvent<AutoOrientComponent, EntParentChangedMessage>(OnAutoParentChange);
+
SubscribeLocalEvent<FollowedComponent, EntParentChangedMessage>(OnFollowedParentChange);
_configManager.OnValueChanged(CCVars.CameraRotationLocked, SetCameraRotationLocked, true);
protected virtual void HandleShuttleInput(EntityUid uid, ShuttleButtons button, ushort subTick, bool state) {}
+ private void OnAutoParentChange(EntityUid uid, AutoOrientComponent component, ref EntParentChangedMessage args)
+ {
+ ResetCamera(uid);
+ }
+
public void RotateCamera(EntityUid uid, Angle angle)
{
if (CameraRotationLocked || !TryComp<InputMoverComponent>(uid, out var mover))