Skip to content

Commit

Permalink
Fix drag-drop buckle sound playing twice (space-wizards#24321)
Browse files Browse the repository at this point in the history
Buckle refactor somedayTM.
  • Loading branch information
metalgearsloth authored Jan 20, 2024
1 parent 4a13dbe commit bbbacf9
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions Content.Shared/Buckle/SharedBuckleSystem.Buckle.cs
Original file line number Diff line number Diff line change
Expand Up @@ -362,8 +362,7 @@ public bool TryBuckle(EntityUid buckleUid, EntityUid userUid, EntityUid strapUid
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);
Expand Down

0 comments on commit bbbacf9

Please sign in to comment.