Fix SoundManager::isPlaying to consider multiple entries with the same Ptr/id

Now it returns true if *any* sounds matching the given Ptr and id are playing. The previous behaviour was causing problems with "zombie" sounds (sounds that have finished playing, but weren't removed from the map yet) making the isPlaying method return false even though there's another legitimately playing sound in the map.
openmw-37
scrawl 9 years ago
parent 5de9a5e840
commit 038f682510

@ -168,8 +168,8 @@ namespace MWSound
SoundMap::const_iterator snditer = mActiveSounds.begin(); SoundMap::const_iterator snditer = mActiveSounds.begin();
while(snditer != mActiveSounds.end()) while(snditer != mActiveSounds.end())
{ {
if(snditer->second.first == ptr && snditer->second.second == id) if(snditer->second.first == ptr && snditer->second.second == id && snditer->first->isPlaying())
return snditer->first->isPlaying(); return true;
++snditer; ++snditer;
} }
return false; return false;

Loading…
Cancel
Save