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:
@@ -13,6 +13,8 @@ namespace Content.Shared.Buckle
|
||||
public override void Initialize()
|
||||
{
|
||||
base.Initialize();
|
||||
SubscribeLocalEvent<SharedStrapComponent, RotateEvent>(OnStrapRotate);
|
||||
|
||||
SubscribeLocalEvent<SharedBuckleComponent, PreventCollideEvent>(PreventCollision);
|
||||
SubscribeLocalEvent<SharedBuckleComponent, DownAttemptEvent>(HandleDown);
|
||||
SubscribeLocalEvent<SharedBuckleComponent, StandAttemptEvent>(HandleStand);
|
||||
@@ -21,6 +23,23 @@ namespace Content.Shared.Buckle
|
||||
SubscribeLocalEvent<SharedBuckleComponent, ChangeDirectionAttemptEvent>(OnBuckleChangeDirectionAttempt);
|
||||
}
|
||||
|
||||
private void OnStrapRotate(EntityUid uid, SharedStrapComponent component, ref RotateEvent args)
|
||||
{
|
||||
// TODO: This looks dirty af.
|
||||
// On rotation of a strap, reattach all buckled entities.
|
||||
// This fixes buckle offsets and draw depths.
|
||||
foreach (var buckledEntity in component.BuckledEntities)
|
||||
{
|
||||
if (!EntityManager.TryGetComponent(buckledEntity, out SharedBuckleComponent? buckled))
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
buckled.ReAttach(component);
|
||||
Dirty(buckled);
|
||||
}
|
||||
}
|
||||
|
||||
private void OnBuckleChangeDirectionAttempt(EntityUid uid, SharedBuckleComponent component, ChangeDirectionAttemptEvent args)
|
||||
{
|
||||
if (component.Buckled)
|
||||
|
||||
Reference in New Issue
Block a user