Skip to content

Commit

Permalink
Fixed buckled players thrashing while speaking in beds (space-wizards…
Browse files Browse the repository at this point in the history
…#29653)

* Fix characters thrashing when talking while lying down

* Remove weird design choice
  • Loading branch information
Tayrtahn authored Jul 2, 2024
1 parent 2f1bc7a commit b565258
Showing 2 changed files with 6 additions and 2 deletions.
4 changes: 2 additions & 2 deletions Content.Client/Rotation/RotationVisualizerSystem.cs
Original file line number Diff line number Diff line change
@@ -23,8 +23,8 @@ private void OnAppearanceChange(EntityUid uid, RotationVisualsComponent componen
if (args.Sprite == null)
return;

// If not defined, defaults to standing.
_appearance.TryGetData<RotationState>(uid, RotationVisuals.RotationState, out var state, args.Component);
if (!_appearance.TryGetData<RotationState>(uid, RotationVisuals.RotationState, out var state, args.Component))
return;

switch (state)
{
4 changes: 4 additions & 0 deletions Content.Shared/Buckle/SharedBuckleSystem.Buckle.cs
Original file line number Diff line number Diff line change
@@ -9,6 +9,7 @@
using Content.Shared.Movement.Pulling.Events;
using Content.Shared.Popups;
using Content.Shared.Pulling.Events;
using Content.Shared.Rotation;
using Content.Shared.Standing;
using Content.Shared.Storage.Components;
using Content.Shared.Stunnable;
@@ -195,6 +196,7 @@ protected void SetBuckledTo(Entity<BuckleComponent> buckle, Entity<StrapComponen
buckle.Comp.BuckleTime = _gameTiming.CurTime;
ActionBlocker.UpdateCanMove(buckle);
Appearance.SetData(buckle, StrapVisuals.State, buckle.Comp.Buckled);
Appearance.SetData(buckle, RotationVisuals.RotationState, RotationState.Horizontal);
Dirty(buckle);
}

@@ -348,6 +350,7 @@ private void Buckle(Entity<BuckleComponent> buckle, Entity<StrapComponent> strap
SetBuckledTo(buckle, strap!);
Appearance.SetData(strap, StrapVisuals.State, true);
Appearance.SetData(buckle, BuckleVisuals.Buckled, true);
Appearance.SetData(buckle, RotationVisuals.RotationState, RotationState.Horizontal);

_rotationVisuals.SetHorizontalAngle(buckle.Owner, strap.Comp.Rotation);

@@ -455,6 +458,7 @@ private void Unbuckle(Entity<BuckleComponent> buckle, Entity<StrapComponent> str
_rotationVisuals.ResetHorizontalAngle(buckle.Owner);
Appearance.SetData(strap, StrapVisuals.State, strap.Comp.BuckledEntities.Count != 0);
Appearance.SetData(buckle, BuckleVisuals.Buckled, false);
Appearance.SetData(buckle, RotationVisuals.RotationState, RotationState.Vertical);

if (HasComp<KnockedDownComponent>(buckle) || _mobState.IsIncapacitated(buckle))
_standing.Down(buckle);

0 comments on commit b565258

Please sign in to comment.