Fix duplicate mech footstep sounds (#12972)
* Fix duplicate mech footstep sounds We just add a new component for relay targets so we can use that for audio prediction. * Fix cwash * woop
This commit is contained in:
@@ -287,7 +287,18 @@ namespace Content.Shared.Movement.Systems
|
||||
.WithVolume(FootstepVolume * soundModifier)
|
||||
.WithVariation(sound.Params.Variation ?? FootstepVariation);
|
||||
|
||||
_audio.PlayPredicted(sound, mover.Owner, mover.Owner, audioParams);
|
||||
// If we're a relay target then predict the sound for all relays.
|
||||
if (TryComp<MovementRelayTargetComponent>(mover.Owner, out var targetComp))
|
||||
{
|
||||
foreach (var ent in targetComp.Entities)
|
||||
{
|
||||
_audio.PlayPredicted(sound, mover.Owner, ent, audioParams);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
_audio.PlayPredicted(sound, mover.Owner, mover.Owner, audioParams);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user