mirror of
https://gitea.sffempire.ru/Kolyah35/minecraft-pe-0.6.1.git
synced 2026-03-20 06:53:30 +00:00
Fixes and enhancements from my MCPE repository. (https://github.com/mschiller890/mcpe64)
This commit is contained in:
@@ -230,10 +230,13 @@ 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, 0.0f, 1.0f);
|
||||
volume = Mth::clamp( volume * _getVolumeMult(x, y, z), 0.0f, 1.0f);
|
||||
if (/*!loaded || */options->sound == 0 || volume <= 0) return;
|
||||
|
||||
SoundDesc sound;
|
||||
if (sounds.get(name, sound)) {
|
||||
float dist = SOUND_DISTANCE;
|
||||
if (volume > 1) dist *= volume;
|
||||
soundSystem.playAt(sound, x-_x, y-_y, z-_z, volume, pitch);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user