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
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
using Content.Shared.ActionBlocker;
|
||||
using Content.Shared.Pulling.Components;
|
||||
using Content.Shared.MobState.Components;
|
||||
using Content.Shared.MobState.EntitySystems;
|
||||
using Content.Shared.Movement.Events;
|
||||
|
||||
namespace Content.Shared.Pulling.Systems
|
||||
@@ -8,19 +8,20 @@ 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, RelayMoveInputEvent>(OnRelayMoveInput);
|
||||
SubscribeLocalEvent<SharedPullableComponent, MoveInputEvent>(OnRelayMoveInput);
|
||||
}
|
||||
|
||||
private void OnRelayMoveInput(EntityUid uid, SharedPullableComponent component, RelayMoveInputEvent args)
|
||||
private void OnRelayMoveInput(EntityUid uid, SharedPullableComponent component, ref MoveInputEvent args)
|
||||
{
|
||||
var entity = args.Session.AttachedEntity;
|
||||
if (entity == null || !_blocker.CanMove(entity.Value)) return;
|
||||
if (TryComp<MobStateComponent>(component.Owner, out var mobState) && mobState.IsIncapacitated()) return;
|
||||
var entity = args.Entity;
|
||||
if (_mobState.IsIncapacitated(entity) || !_blocker.CanMove(entity)) return;
|
||||
|
||||
_pullSystem.TryStopPull(component);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user