only write cache index on success

This commit is contained in:
Glenn Maynard
2008-07-13 22:23:24 +00:00
parent d8eefddbcd
commit 77821c179a
+2 -3
View File
@@ -388,9 +388,8 @@ bool CourseLoaderCRS::LoadFromCRSFile( const RString &_sPath, Course &out )
if( out.m_RadarCache.size() )
{
RString sCachePath = out.GetCacheFilePath();
CourseWriterCRS::Write( out, sCachePath, true );
SONGINDEX->AddCacheIndex( out.m_sPath, GetHashForFile(out.m_sPath) );
if( CourseWriterCRS::Write(out, sCachePath, true) )
SONGINDEX->AddCacheIndex( out.m_sPath, GetHashForFile(out.m_sPath) );
}
}