Fix weird rotation when strapped to a bed (#24746)
* Gotta watch out for those tricky radians * Change StrapComponent instead
This commit is contained in:
@@ -66,11 +66,11 @@ public sealed partial class StrapComponent : Component
|
|||||||
public Vector2 BuckleOffset = Vector2.Zero;
|
public Vector2 BuckleOffset = Vector2.Zero;
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// The angle in degrees to rotate the player by when they get strapped
|
/// The angle to rotate the player by when they get strapped
|
||||||
/// </summary>
|
/// </summary>
|
||||||
[DataField]
|
[DataField]
|
||||||
[ViewVariables(VVAccess.ReadWrite)]
|
[ViewVariables(VVAccess.ReadWrite)]
|
||||||
public int Rotation;
|
public Angle Rotation;
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// The size of the strap which is compared against when buckling entities
|
/// The size of the strap which is compared against when buckling entities
|
||||||
|
|||||||
@@ -357,7 +357,7 @@ public abstract partial class SharedBuckleSystem
|
|||||||
if (TryComp<AppearanceComponent>(buckleUid, out var appearance))
|
if (TryComp<AppearanceComponent>(buckleUid, out var appearance))
|
||||||
Appearance.SetData(buckleUid, BuckleVisuals.Buckled, true, appearance);
|
Appearance.SetData(buckleUid, BuckleVisuals.Buckled, true, appearance);
|
||||||
|
|
||||||
_rotationVisuals.SetHorizontalAngle(buckleUid, strapComp.Rotation);
|
_rotationVisuals.SetHorizontalAngle(buckleUid, strapComp.Rotation);
|
||||||
|
|
||||||
ReAttach(buckleUid, strapUid, buckleComp, strapComp);
|
ReAttach(buckleUid, strapUid, buckleComp, strapComp);
|
||||||
SetBuckledTo(buckleUid, strapUid, strapComp, buckleComp);
|
SetBuckledTo(buckleUid, strapUid, strapComp, buckleComp);
|
||||||
|
|||||||
Reference in New Issue
Block a user