Fix rotation visuals desync & appearance state spam (#23016)

* Fix rotation visuals desync

* :bucklemeup:

* A
This commit is contained in:
Leon Friedrich
2023-12-26 18:32:25 -05:00
committed by GitHub
parent 476ea14e8a
commit cf98300ba2
13 changed files with 106 additions and 69 deletions

View File

@@ -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)