Fix hash check for course cache files. Do not attempt to calculate radar values if there are no entries.
This commit is contained in:
@@ -318,7 +318,9 @@ bool CourseLoaderCRS::LoadFromMsd( const RString &sPath, const MsdFile &msd, Cou
|
|||||||
|
|
||||||
/* Cache and load the course banner. Only bother doing this if at least one
|
/* Cache and load the course banner. Only bother doing this if at least one
|
||||||
* song was found in the course. */
|
* song was found in the course. */
|
||||||
if( out.m_sBannerPath != "" && !out.m_vEntries.empty() )
|
if( out.m_vEntries.empty() )
|
||||||
|
return true;
|
||||||
|
if( out.m_sBannerPath != "" )
|
||||||
BANNERCACHE->CacheBanner( out.GetBannerPath() );
|
BANNERCACHE->CacheBanner( out.GetBannerPath() );
|
||||||
|
|
||||||
/* Cache each trail RadarValues that's slow to load, so we
|
/* Cache each trail RadarValues that's slow to load, so we
|
||||||
@@ -356,7 +358,7 @@ bool CourseLoaderCRS::LoadFromCRSFile( const RString &_sPath, Course &out )
|
|||||||
unsigned uHash = SONGINDEX->GetCacheHash( out.m_sPath );
|
unsigned uHash = SONGINDEX->GetCacheHash( out.m_sPath );
|
||||||
if( !DoesFileExist(out.GetCacheFilePath()) )
|
if( !DoesFileExist(out.GetCacheFilePath()) )
|
||||||
bUseCache = false;
|
bUseCache = false;
|
||||||
if( !PREFSMAN->m_bFastLoad && GetHashForDirectory(out.m_sPath) != uHash )
|
if( !PREFSMAN->m_bFastLoad && GetHashForFile(out.m_sPath) != uHash )
|
||||||
bUseCache = false; // this cache is out of date
|
bUseCache = false; // this cache is out of date
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -364,7 +366,7 @@ bool CourseLoaderCRS::LoadFromCRSFile( const RString &_sPath, Course &out )
|
|||||||
{
|
{
|
||||||
RString sCacheFile = out.GetCacheFilePath();
|
RString sCacheFile = out.GetCacheFilePath();
|
||||||
LOG->Trace( "CourseLoaderCRS::LoadFromCRSFile(\"%s\") (\"%s\")", sPath.c_str(), sCacheFile.c_str() );
|
LOG->Trace( "CourseLoaderCRS::LoadFromCRSFile(\"%s\") (\"%s\")", sPath.c_str(), sCacheFile.c_str() );
|
||||||
sPath = sCacheFile.c_str();
|
sPath = sCacheFile;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
|||||||
Reference in New Issue
Block a user