Don't crash if no loading screens are found

This commit is contained in:
scrawl 2012-12-03 05:45:04 +01:00
parent ea2bbec76e
commit 3db850a7d1

View file

@ -226,9 +226,14 @@ namespace MWGui
if (start == "splash")
splash.push_back (*it);
}
std::string randomSplash = splash[rand() % splash.size()];
if (splash.size())
{
std::string randomSplash = splash[rand() % splash.size()];
Ogre::TexturePtr tex = Ogre::TextureManager::getSingleton ().load (randomSplash, "General");
mBackgroundImage->setImageTexture (randomSplash);
Ogre::TexturePtr tex = Ogre::TextureManager::getSingleton ().load (randomSplash, "General");
mBackgroundImage->setImageTexture (randomSplash);
}
else
std::cerr << "No loading screens found!" << std::endl;
}
}