protection against bogus config files

git-svn-id: svn+ssh://svn.code.sf.net/p/supertuxkart/code/main/branches/irrlicht@3635 178a84e3-b1eb-0310-8ba1-8eac791a3b58
This commit is contained in:
auria 2009-06-22 01:45:56 +00:00
parent 7f709e4abb
commit bd48fc0b8e

View File

@ -333,7 +333,7 @@ UserConfig *user_config;
UserConfig::UserConfig()
{
setDefaults();
if(!loadConfig())
if(!loadConfig() || UserConfigParams::m_player.size() == 0)
{
addDefaultPlayer();
}
@ -343,7 +343,7 @@ UserConfig::UserConfig()
UserConfig::UserConfig(const std::string& filename)
{
setDefaults();
if(!loadConfig(filename))
if(!loadConfig(filename) || UserConfigParams::m_player.size() == 0)
{
addDefaultPlayer();
}