fix movement audio service when no audio engine

This commit is contained in:
austin 2024-10-21 09:53:58 -04:00
parent ef724d3832
commit 496172680f
2 changed files with 12 additions and 6 deletions

View File

@ -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

View File

@ -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);
}
}
}