Footstep SFX are played on entity coordinates, instead of following the entity.
This prevents client-side "can't play sound" spam when the entity is NaN'd due to PVS.
This commit is contained in:
@@ -88,7 +88,7 @@ namespace Content.Server.Actions
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
SoundSystem.Play(Filter.Pvs(args.Performer), "/Audio/Effects/thudswoosh.ogg", args.Performer,
|
SoundSystem.Play(Filter.Pvs(args.Performer), "/Audio/Effects/thudswoosh.ogg", args.Performer.Transform.Coordinates,
|
||||||
AudioHelpers.WithVariation(0.025f));
|
AudioHelpers.WithVariation(0.025f));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -31,7 +31,7 @@ namespace Content.Server.GameObjects.Components.Sound
|
|||||||
{
|
{
|
||||||
var soundCollection = _prototypeManager.Index<SoundCollectionPrototype>(_soundCollectionName);
|
var soundCollection = _prototypeManager.Index<SoundCollectionPrototype>(_soundCollectionName);
|
||||||
var file = _footstepRandom.Pick(soundCollection.PickFiles);
|
var file = _footstepRandom.Pick(soundCollection.PickFiles);
|
||||||
SoundSystem.Play(Filter.Pvs(Owner), file, Owner, AudioParams.Default.WithVolume(-2f));
|
SoundSystem.Play(Filter.Pvs(Owner), file, Owner.Transform.Coordinates, AudioParams.Default.WithVolume(-2f));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -187,7 +187,7 @@ namespace Content.Server.Physics.Controllers
|
|||||||
SoundSystem.Play(
|
SoundSystem.Play(
|
||||||
Filter.Pvs(coordinates),
|
Filter.Pvs(coordinates),
|
||||||
_robustRandom.Pick(soundCollection.PickFiles),
|
_robustRandom.Pick(soundCollection.PickFiles),
|
||||||
mover,
|
mover.Transform.Coordinates,
|
||||||
sprinting ? AudioParams.Default.WithVolume(0.75f) : null);
|
sprinting ? AudioParams.Default.WithVolume(0.75f) : null);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user