Fix drag-drop buckle sound playing twice (#24321)

Buckle refactor somedayTM.
This commit is contained in:
metalgearsloth
2024-01-20 17:22:19 +11:00
committed by GitHub
parent 4a13dbea76
commit bbbacf996b

View File

@@ -362,8 +362,7 @@ public abstract partial class SharedBuckleSystem
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
var audioSourceUid = userUid == buckleUid ? userUid : strapUid;
_audio.PlayPredicted(strapComp.BuckleSound, strapUid, audioSourceUid);
_audio.PlayPredicted(strapComp.BuckleSound, strapUid, userUid);
var ev = new BuckleChangeEvent(strapUid, buckleUid, true);
RaiseLocalEvent(ev.BuckledEntity, ref ev);