From cb44e7eddaf117bf09ab90e8ec64f2879fc66c16 Mon Sep 17 00:00:00 2001 From: Glenn Maynard Date: Tue, 10 Sep 2002 22:55:12 +0000 Subject: [PATCH] Invalidate cache due to addition of Pump couples loading. Don't add songs that fail to load. --- stepmania/src/Song.cpp | 2 +- stepmania/src/SongManager.cpp | 9 +++++++-- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/stepmania/src/Song.cpp b/stepmania/src/Song.cpp index 63b75b61f6..5abf446187 100644 --- a/stepmania/src/Song.cpp +++ b/stepmania/src/Song.cpp @@ -45,7 +45,7 @@ #include "NotesLoaderKSF.h" #include "NotesWriterDWI.h" -const int FILE_CACHE_VERSION = 65; // increment this when Song or Notes changes to invalidate cache +const int FILE_CACHE_VERSION = 66; // increment this when Song or Notes changes to invalidate cache int CompareBPMSegments(const void *arg1, const void *arg2) diff --git a/stepmania/src/SongManager.cpp b/stepmania/src/SongManager.cpp index 8454dad973..ded5b131ce 100644 --- a/stepmania/src/SongManager.cpp +++ b/stepmania/src/SongManager.cpp @@ -150,8 +150,13 @@ void SongManager::LoadStepManiaSongDir( CString sDir, void(*callback)() ) if( callback ) callback(); Song* pNewSong = new Song; - pNewSong->LoadFromSongDir( ssprintf("%s\\%s\\%s", sDir, sGroupDirName, sSongDirName) ); - m_pSongs.Add( pNewSong ); + if( !pNewSong->LoadFromSongDir( ssprintf("%s\\%s\\%s", sDir, sGroupDirName, sSongDirName) ) ) { + /* The song failed to load. */ + delete pNewSong; + continue; + } + + m_pSongs.Add( pNewSong ); loaded++; }