This is a re-commit of this feature from MR yarn run test where shandley had a catastrophic git cockup.

This commit is contained in:
S Handley 2019-10-04 09:58:58 +00:00 committed by Marcel
parent e4785b8a5d
commit 810a7e5b5d

View File

@ -22,6 +22,7 @@ impl SoundMgr {
}
pub fn maintain(&mut self, audio: &mut AudioFrontend, client: &Client) {
const SFX_DIST_LIMIT_SQR: f32 = 22500.0;
let ecs = client.state().ecs();
// Get player position.
let player_pos = ecs
@ -43,6 +44,7 @@ impl SoundMgr {
ecs.read_storage::<CharacterState>().maybe(),
)
.join()
.filter(|(_, e_pos, _, _)| (e_pos.0.distance_squared(player_pos)) < SFX_DIST_LIMIT_SQR)
{
if let (Body::Humanoid(_), Some(character)) = (body, character) {
let state = self