* 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
27 lines
941 B
C#
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;
|
|
}
|
|
}
|
|
}
|