Fix dead mob sprites rotating on death (#16317)

This commit is contained in:
themias
2023-05-11 07:20:41 -04:00
committed by GitHub
parent cb70863ccf
commit e6dd47ea46
6 changed files with 9 additions and 3 deletions

View File

@@ -70,7 +70,7 @@ internal sealed class BuckleSystem : SharedBuckleSystem
!buckled ||
args.Sprite == null)
{
_rotationVisualizerSystem.SetHorizontalAngle(uid, RotationVisualsComponent.DefaultRotation, rotVisuals);
_rotationVisualizerSystem.SetHorizontalAngle(uid, rotVisuals.DefaultRotation, rotVisuals);
return;
}

View File

@@ -3,12 +3,16 @@ namespace Content.Client.Rotation;
[RegisterComponent]
public sealed class RotationVisualsComponent : Component
{
public static readonly Angle DefaultRotation = Angle.FromDegrees(90);
[DataField("defaultRotation")]
[ViewVariables(VVAccess.ReadOnly)]
public readonly Angle DefaultRotation = Angle.FromDegrees(90);
[ViewVariables(VVAccess.ReadWrite)]
public Angle VerticalRotation = 0;
[ViewVariables(VVAccess.ReadWrite)] public Angle HorizontalRotation = DefaultRotation;
[DataField("horizontalRotation")]
[ViewVariables(VVAccess.ReadWrite)]
public Angle HorizontalRotation = Angle.FromDegrees(90);
[ViewVariables(VVAccess.ReadWrite)]
public float AnimationTime = 0.125f;

View File

@@ -130,6 +130,8 @@
Brute: 5
- type: Appearance
- type: RotationVisuals
defaultRotation: 0
horizontalRotation: 0
- type: FireVisuals
sprite: Mobs/Effects/onfire.rsi
normalState: Generic_mob_burning

Binary file not shown.

Before

Width:  |  Height:  |  Size: 475 B

After

Width:  |  Height:  |  Size: 490 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 465 B

After

Width:  |  Height:  |  Size: 484 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 456 B

After

Width:  |  Height:  |  Size: 457 B