fix Song thinks it's cached even if writing the cache file fails

This commit is contained in:
Glenn Maynard
2008-03-07 21:22:43 +00:00
parent abc07a63d4
commit 630f8f2f7c
+4 -2
View File
@@ -208,7 +208,7 @@ bool Song::LoadFromSongDir( RString sDir )
//
unsigned uCacheHash = SONGINDEX->GetCacheHash(m_sSongDir);
bool bUseCache = true;
const RString sCacheFilePath = GetCacheFilePath();
RString sCacheFilePath = GetCacheFilePath();
if( !DoesFileExist(sCacheFilePath) )
bUseCache = false;
@@ -246,8 +246,10 @@ bool Song::LoadFromSongDir( RString sDir )
// Continue on with a blank Song so that people can make adjustments using the editor.
}
TidyUpData();
// save a cache file so we don't have to parse it all over again next time
SaveToCacheFile();
if( !SaveToCacheFile() )
sCacheFilePath = RString();
}