Buckle sound fix (#18662)
* Resolve buckle audio playing twice Note: Unbuckling other still plays twice. :( * Resolve unbuckling other AAAAAAAAAAAAAAAAAAAAAAAAAAA * Remove newline that I added for no reason at all
This commit is contained in:
@@ -1,4 +1,4 @@
|
|||||||
using System.Diagnostics.CodeAnalysis;
|
using System.Diagnostics.CodeAnalysis;
|
||||||
using System.Numerics;
|
using System.Numerics;
|
||||||
using Content.Shared.Alert;
|
using Content.Shared.Alert;
|
||||||
using Content.Shared.Bed.Sleep;
|
using Content.Shared.Bed.Sleep;
|
||||||
@@ -357,7 +357,8 @@ public abstract partial class SharedBuckleSystem
|
|||||||
ReAttach(buckleUid, strapUid, buckleComp, strapComp);
|
ReAttach(buckleUid, strapUid, buckleComp, strapComp);
|
||||||
SetBuckledTo(buckleUid,strapUid, strapComp, buckleComp);
|
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
|
// TODO user is currently set to null because if it isn't the sound fails to play in some situations, fix that
|
||||||
_audioSystem.PlayPredicted(strapComp.BuckleSound, strapUid, null);
|
var audioSourceUid = userUid == buckleUid ? userUid : strapUid;
|
||||||
|
_audioSystem.PlayPredicted(strapComp.BuckleSound, strapUid, audioSourceUid);
|
||||||
|
|
||||||
var ev = new BuckleChangeEvent(strapUid, buckleUid, true);
|
var ev = new BuckleChangeEvent(strapUid, buckleUid, true);
|
||||||
RaiseLocalEvent(ev.BuckledEntity, ref ev);
|
RaiseLocalEvent(ev.BuckledEntity, ref ev);
|
||||||
@@ -483,7 +484,8 @@ public abstract partial class SharedBuckleSystem
|
|||||||
}
|
}
|
||||||
|
|
||||||
AppearanceSystem.SetData(strapUid, StrapVisuals.State, strapComp.BuckledEntities.Count != 0);
|
AppearanceSystem.SetData(strapUid, StrapVisuals.State, strapComp.BuckledEntities.Count != 0);
|
||||||
_audioSystem.PlayPredicted(strapComp.UnbuckleSound, strapUid, null);
|
var audioSourceUid = userUid != buckleUid ? userUid : strapUid;
|
||||||
|
_audioSystem.PlayPredicted(strapComp.UnbuckleSound, strapUid, audioSourceUid);
|
||||||
|
|
||||||
var ev = new BuckleChangeEvent(strapUid, buckleUid, false);
|
var ev = new BuckleChangeEvent(strapUid, buckleUid, false);
|
||||||
RaiseLocalEvent(buckleUid, ref ev);
|
RaiseLocalEvent(buckleUid, ref ev);
|
||||||
|
|||||||
Reference in New Issue
Block a user