Fix rotation visuals desync & appearance state spam (#23016)
* Fix rotation visuals desync * :bucklemeup: * A
This commit is contained in:
@@ -357,6 +357,8 @@ public abstract partial class SharedBuckleSystem
|
||||
if (TryComp<AppearanceComponent>(buckleUid, out var appearance))
|
||||
Appearance.SetData(buckleUid, BuckleVisuals.Buckled, true, appearance);
|
||||
|
||||
_rotationVisuals.SetHorizontalAngle(buckleUid, strapComp.Rotation);
|
||||
|
||||
ReAttach(buckleUid, strapUid, buckleComp, strapComp);
|
||||
SetBuckledTo(buckleUid, strapUid, strapComp, buckleComp);
|
||||
// TODO user is currently set to null because if it isn't the sound fails to play in some situations, fix that
|
||||
@@ -471,6 +473,7 @@ public abstract partial class SharedBuckleSystem
|
||||
|
||||
if (TryComp(buckleUid, out AppearanceComponent? appearance))
|
||||
Appearance.SetData(buckleUid, BuckleVisuals.Buckled, false, appearance);
|
||||
_rotationVisuals.ResetHorizontalAngle(buckleUid);
|
||||
|
||||
if (TryComp<MobStateComponent>(buckleUid, out var mobState)
|
||||
&& _mobState.IsIncapacitated(buckleUid, mobState)
|
||||
|
||||
@@ -5,6 +5,7 @@ using Content.Shared.Destructible;
|
||||
using Content.Shared.DragDrop;
|
||||
using Content.Shared.Foldable;
|
||||
using Content.Shared.Interaction;
|
||||
using Content.Shared.Rotation;
|
||||
using Content.Shared.Storage;
|
||||
using Content.Shared.Verbs;
|
||||
using Robust.Shared.Containers;
|
||||
@@ -13,6 +14,8 @@ namespace Content.Shared.Buckle;
|
||||
|
||||
public abstract partial class SharedBuckleSystem
|
||||
{
|
||||
[Dependency] private readonly SharedRotationVisualsSystem _rotationVisuals = default!;
|
||||
|
||||
private void InitializeStrap()
|
||||
{
|
||||
SubscribeLocalEvent<StrapComponent, ComponentStartup>(OnStrapStartup);
|
||||
@@ -292,8 +295,6 @@ public abstract partial class SharedBuckleSystem
|
||||
|
||||
strapComp.OccupiedSize += buckleComp.Size;
|
||||
|
||||
Appearance.SetData(buckleUid, StrapVisuals.RotationAngle, strapComp.Rotation);
|
||||
|
||||
Appearance.SetData(strapUid, StrapVisuals.State, true);
|
||||
|
||||
Dirty(strapUid, strapComp);
|
||||
|
||||
Reference in New Issue
Block a user