From: <hik...@us...> - 2008-02-18 10:13:33
|
Revision: 1515 http://supertuxkart.svn.sourceforge.net/supertuxkart/?rev=1515&view=rev Author: hikerstk Date: 2008-02-18 02:13:25 -0800 (Mon, 18 Feb 2008) Log Message: ----------- Fixed crash/abort in STK when the .readme file for a song wasn't found. Modified Paths: -------------- trunk/supertuxkart/src/sound_manager.cpp Modified: trunk/supertuxkart/src/sound_manager.cpp =================================================================== --- trunk/supertuxkart/src/sound_manager.cpp 2008-02-18 04:27:49 UTC (rev 1514) +++ trunk/supertuxkart/src/sound_manager.cpp 2008-02-18 10:13:25 UTC (rev 1515) @@ -190,9 +190,21 @@ return; } + m_current_music->playMusic(); + // Read up to two lines from the corresponding .readme file: first one // the title, second the composer. This is then displayed by the race gui - std::string name_readme = loader->getPath(StringUtils::without_extension(filename)+".readme"); + std::string name_readme; + try + { + name_readme = loader->getPath( + StringUtils::without_extension(filename)+".readme"); + } + catch(std::exception) + { + // Silently ignore any missing .readme files, m_description was cleared above + return; + } std::ifstream f(name_readme.c_str()); if(f) { @@ -201,7 +213,6 @@ std::getline(f,s); if(!f.eof()) m_description.push_back(s); f.close(); } - m_current_music->playMusic(); } // playMusic //----------------------------------------------------------------------------- This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |