Assert.That(buckle.Buckled);
Assert.That(actionBlocker.CanMove(human), Is.False);
- Assert.That(actionBlocker.CanChangeDirection(human), Is.False);
+ Assert.That(actionBlocker.CanChangeDirection(human));
Assert.That(standingState.Down(human), Is.False);
Assert.That(
(xformSystem.GetWorldPosition(human) - xformSystem.GetWorldPosition(chair)).LengthSquared,
using Content.Shared.Hands.Components;
using Content.Shared.IdentityManagement;
using Content.Shared.Interaction;
-using Content.Shared.Interaction.Events;
using Content.Shared.Mobs.Components;
using Content.Shared.Movement.Events;
using Content.Shared.Popups;
SubscribeLocalEvent<BuckleComponent, StandAttemptEvent>(OnBuckleStandAttempt);
SubscribeLocalEvent<BuckleComponent, ThrowPushbackAttemptEvent>(OnBuckleThrowPushbackAttempt);
SubscribeLocalEvent<BuckleComponent, UpdateCanMoveEvent>(OnBuckleUpdateCanMove);
- SubscribeLocalEvent<BuckleComponent, ChangeDirectionAttemptEvent>(OnBuckleChangeDirectionAttempt);
}
private void OnBuckleComponentStartup(EntityUid uid, BuckleComponent component, ComponentStartup args)
args.Cancel();
}
- private void OnBuckleChangeDirectionAttempt(EntityUid uid, BuckleComponent component, ChangeDirectionAttemptEvent args)
- {
- if (component.Buckled)
- args.Cancel();
- }
-
public bool IsBuckled(EntityUid uid, BuckleComponent? component = null)
{
return Resolve(uid, ref component, false) && component.Buckled;
public bool TryFaceAngle(EntityUid user, Angle diffAngle, TransformComponent? xform = null)
{
- if (_actionBlockerSystem.CanChangeDirection(user))
- {
- if (!Resolve(user, ref xform))
- return false;
-
- _transform.SetWorldRotation(xform, diffAngle);
- return true;
- }
+ if (!_actionBlockerSystem.CanChangeDirection(user))
+ return false;
if (EntityManager.TryGetComponent(user, out BuckleComponent? buckle) && buckle.Buckled)
{
return true;
}
}
+
+ return false;
}
- return false;
+ // user is not buckled in; apply to their transform
+ if (!Resolve(user, ref xform))
+ return false;
+
+ _transform.SetWorldRotation(xform, diffAngle);
+ return true;
}
}
}