Fix: Sounds (now properly)

This commit is contained in:
InviseDivine
2026-03-09 14:11:28 +02:00
parent d0f6a9b805
commit 6c22f3bc25
2 changed files with 2 additions and 6 deletions

View File

@@ -230,14 +230,11 @@ void SoundEngine::playUI(const std::string& name, float volume, float pitch) {}
void SoundEngine::play(const std::string& name, float x, float y, float z, float volume, float pitch) {
if ((volume *= options->sound) <= 0) return;
volume = Mth::clamp( volume * _getVolumeMult(x, y, z), 0.0f, 1.0f);
if (/*!loaded || */options->sound == 0 || volume <= 0) return;
volume = Mth::clamp(volume, 0.0f, 1.0f);
SoundDesc sound;
if (sounds.get(name, sound)) {
float dist = SOUND_DISTANCE;
if (volume > 1) dist *= volume;
soundSystem.playAt(sound, x, y, z, volume, pitch);
soundSystem.playAt(sound, x-_x, y-_y, z-_z, volume, pitch);
}
}
void SoundEngine::playUI(const std::string& name, float volume, float pitch) {