1
0
Fork 1
mirror of https://github.com/TES3MP/openmw-tes3mp.git synced 2025-01-31 21:45:33 +00:00

Fix startRandomTitle

This commit is contained in:
scrawl 2013-04-04 15:10:27 +02:00
parent ebaf80d539
commit 48a88f1917

View file

@ -208,14 +208,21 @@ namespace MWSound
void SoundManager::startRandomTitle()
{
Ogre::StringVectorPtr filelist;
filelist = mResourceMgr.findResourceNames(Ogre::ResourceGroupManager::DEFAULT_RESOURCE_GROUP_NAME,
"Music/"+mCurrentPlaylist+"/*");
if(!filelist->size())
Ogre::StringVector filelist;
Ogre::StringVector groups = Ogre::ResourceGroupManager::getSingleton().getResourceGroups ();
for (Ogre::StringVector::iterator it = groups.begin(); it != groups.end(); ++it)
{
Ogre::StringVectorPtr resourcesInThisGroup = mResourceMgr.findResourceNames(*it,
"Music/"+mCurrentPlaylist+"/*");
filelist.insert(filelist.end(), resourcesInThisGroup->begin(), resourcesInThisGroup->end());
}
if(!filelist.size())
return;
int i = rand()%filelist->size();
streamMusicFull((*filelist)[i]);
int i = rand()%filelist.size();
streamMusicFull(filelist[i]);
}
bool SoundManager::isMusicPlaying()