sound: Halt sound sources that go inaudible instead of fading them out

Fixes #3280.
This commit is contained in:
Iris Morelle 2018-06-24 00:35:19 -04:00
parent 15917733e0
commit e46c05162f
2 changed files with 3 additions and 11 deletions

View file

@ -75,6 +75,8 @@
* Fixed MP admins being unable to observe private games.
* Fixed MP faction, leader, and leader gender changes persisting even if the
selection dialog is dismissed.
* Fixed an issue with positioned sound sources ignoring the volume set in
Preferences after going off the audible radius and back (issue #3280).
## Version 1.14.3
### AI

View file

@ -829,17 +829,7 @@ void reposition_sound(int id, unsigned int distance)
}
if(distance >= DISTANCE_SILENT) {
// Don't call Mix_FadeOutChannel if the channel's volume is set to
// zero. It doesn't do anything in that case and the channel will
// resume playing as soon as its volume is reset to a non-zero
// value, which results in issues like sound sources deleted while
// their volume is zero coming back to life and escaping Wesnoth's
// sound source management code.
if(Mix_Volume(ch, -1) == 0) {
Mix_HaltChannel(ch);
} else {
Mix_FadeOutChannel(ch, 100);
}
Mix_HaltChannel(ch);
} else {
Mix_SetDistance(ch, distance);
}