diff --git a/src/client/sound/Sound.h b/src/client/sound/Sound.h index a6577e8..5665c2f 100755 --- a/src/client/sound/Sound.h +++ b/src/client/sound/Sound.h @@ -43,7 +43,6 @@ public: void destroy() const { if (isValid()) { - delete buffer; buffer = 0; } } diff --git a/src/client/sound/SoundEngine.cpp b/src/client/sound/SoundEngine.cpp index 2f5f451..e4bb471 100755 --- a/src/client/sound/SoundEngine.cpp +++ b/src/client/sound/SoundEngine.cpp @@ -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) {