* 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
29 lines
1015 B
C#
29 lines
1015 B
C#
using Content.Shared.ActionBlocker;
|
|
using Content.Shared.Pulling.Components;
|
|
using Content.Shared.MobState.EntitySystems;
|
|
using Content.Shared.Movement.Events;
|
|
|
|
namespace Content.Shared.Pulling.Systems
|
|
{
|
|
public sealed class SharedPullableSystem : EntitySystem
|
|
{
|
|
[Dependency] private readonly ActionBlockerSystem _blocker = default!;
|
|
[Dependency] private readonly SharedMobStateSystem _mobState = default!;
|
|
[Dependency] private readonly SharedPullingSystem _pullSystem = default!;
|
|
|
|
public override void Initialize()
|
|
{
|
|
base.Initialize();
|
|
SubscribeLocalEvent<SharedPullableComponent, MoveInputEvent>(OnRelayMoveInput);
|
|
}
|
|
|
|
private void OnRelayMoveInput(EntityUid uid, SharedPullableComponent component, ref MoveInputEvent args)
|
|
{
|
|
var entity = args.Entity;
|
|
if (_mobState.IsIncapacitated(entity) || !_blocker.CanMove(entity)) return;
|
|
|
|
_pullSystem.TryStopPull(component);
|
|
}
|
|
}
|
|
}
|