Files
tbd-station-14/Content.Client/Buckle/BuckleSystem.cs
metalgearsloth b9e876ca92 The real movement refactor (#9645)
* The real movement refactor

* ref events

* Jetpack cleanup

* a

* Vehicles partially working

* Balance tweaks

* Restore some shitcode

* AAAAAAAA

* Even more prediction

* ECS compstate trying to fix this

* yml

* vehicles kill me

* Don't lock keys

* a

* Fix problem

* Fix sounds

* shuttle inputs

* Shuttle controls

* space brakes

* Keybinds

* Fix merge

* Handle shutdown

* Fix keys

* Bump friction

* fix buckle offset

* Fix relay and friction

* Fix jetpack turning

* contexts amirite
2022-07-16 13:51:52 +10:00

27 lines
941 B
C#

using Content.Client.Buckle.Strap;
using Content.Shared.Buckle;
using Content.Shared.Buckle.Components;
using Robust.Shared.GameStates;
namespace Content.Client.Buckle
{
internal sealed class BuckleSystem : SharedBuckleSystem
{
public override void Initialize()
{
base.Initialize();
SubscribeLocalEvent<StrapComponent, ComponentHandleState>(OnStrapHandleState);
}
private void OnStrapHandleState(EntityUid uid, StrapComponent component, ref ComponentHandleState args)
{
if (args.Current is not StrapComponentState state) return;
component.Position = state.Position;
component.BuckleOffsetUnclamped = state.BuckleOffsetClamped;
component.BuckledEntities.Clear();
component.BuckledEntities.UnionWith(state.BuckledEntities);
component.MaxBuckleDistance = state.MaxBuckleDistance;
}
}
}