From 496172680fa06fd8b32db10081e1e816f5583ddc Mon Sep 17 00:00:00 2001 From: austin Date: Mon, 21 Oct 2024 09:53:58 -0400 Subject: [PATCH] fix movement audio service when no audio engine --- docs/src/progress/renderertodo.md | 2 ++ .../audio/movement/MovementAudioService.java | 16 ++++++++++------ 2 files changed, 12 insertions(+), 6 deletions(-) diff --git a/docs/src/progress/renderertodo.md b/docs/src/progress/renderertodo.md index 8f6b998e..4479793e 100644 --- a/docs/src/progress/renderertodo.md +++ b/docs/src/progress/renderertodo.md @@ -879,6 +879,8 @@ Fix inventory null pointer check on virtualaudiomanager (10/21/2024) Fix inventory message for undefined id on client +Fix movement audio service when audio engine disabled + # TODO diff --git a/src/main/java/electrosphere/audio/movement/MovementAudioService.java b/src/main/java/electrosphere/audio/movement/MovementAudioService.java index 35ee263f..16778265 100644 --- a/src/main/java/electrosphere/audio/movement/MovementAudioService.java +++ b/src/main/java/electrosphere/audio/movement/MovementAudioService.java @@ -153,9 +153,11 @@ public class MovementAudioService { * @param type The interaction type */ public void playAudio(int voxelType, InteractionType type){ - String audioPath = this.getAudioPath(voxelType, type); - if(audioPath != null){ - Globals.virtualAudioSourceManager.createVirtualAudioSource(audioPath, VirtualAudioSourceType.CREATURE, false); + if(Globals.RUN_AUDIO){ + String audioPath = this.getAudioPath(voxelType, type); + if(audioPath != null){ + Globals.virtualAudioSourceManager.createVirtualAudioSource(audioPath, VirtualAudioSourceType.CREATURE, false); + } } } @@ -166,9 +168,11 @@ public class MovementAudioService { * @param position The position of the audio */ public void playAudioPositional(int voxelType, InteractionType type, Vector3d position){ - String audioPath = this.getAudioPath(voxelType, type); - if(audioPath != null){ - Globals.virtualAudioSourceManager.createVirtualAudioSource(audioPath, VirtualAudioSourceType.CREATURE, false, position); + if(Globals.RUN_AUDIO){ + String audioPath = this.getAudioPath(voxelType, type); + if(audioPath != null){ + Globals.virtualAudioSourceManager.createVirtualAudioSource(audioPath, VirtualAudioSourceType.CREATURE, false, position); + } } }