using Robust.Shared.Input;
using Robust.Shared.Input.Binding;
using Robust.Shared.Map.Components;
+using Robust.Shared.Physics;
using Robust.Shared.Player;
using Robust.Shared.Prototypes;
using Robust.Shared.Serialization;
SubscribeLocalEvent<InputMoverComponent, ComponentGetState>(OnMoverGetState);
SubscribeLocalEvent<InputMoverComponent, ComponentHandleState>(OnMoverHandleState);
SubscribeLocalEvent<InputMoverComponent, EntParentChangedMessage>(OnInputParentChange);
+ SubscribeLocalEvent<InputMoverComponent, AnchorStateChangedEvent>(OnAnchorState);
SubscribeLocalEvent<FollowedComponent, EntParentChangedMessage>(OnFollowedParentChange);
Dirty(entity.Owner, entity.Comp);
}
+ private void OnAnchorState(Entity<InputMoverComponent> entity, ref AnchorStateChangedEvent args)
+ {
+ if (!args.Anchored)
+ PhysicsSystem.SetBodyType(entity, BodyType.KinematicController);
+ }
+
private void HandleDirChange(EntityUid entity, Direction dir, ushort subTick, bool state)
{
// Relayed movement just uses the same keybinds given we're moving the relayed entity