diff --git a/stepmania/src/Song.cpp b/stepmania/src/Song.cpp index 58da33ed0b..c8638cdf35 100644 --- a/stepmania/src/Song.cpp +++ b/stepmania/src/Song.cpp @@ -757,13 +757,16 @@ void Song::SaveToSMFile( RString sPath, bool bSavingCache ) FileCopy( sPath, sPath + ".old" ); NotesWriterSM wr; - wr.Write(sPath, *this, bSavingCache); + wr.Write( sPath, *this, bSavingCache ); } void Song::SaveToCacheFile() { SONGINDEX->AddCacheIndex(m_sSongDir, GetHashForDirectory(m_sSongDir)); - SaveToSMFile( GetCacheFilePath(), true ); + const RString sPath = GetCacheFilePath(); + SaveToSMFile( sPath, true ); + FOREACH( Steps*, m_vpSteps, pSteps ) + (*pSteps)->SetFilename( sPath ); } void Song::SaveToDWIFile() diff --git a/stepmania/src/Steps.cpp b/stepmania/src/Steps.cpp index eee01a7340..fa9a5ce262 100644 --- a/stepmania/src/Steps.cpp +++ b/stepmania/src/Steps.cpp @@ -63,12 +63,11 @@ void Steps::SetNoteData( const NoteData& noteDataNew ) NoteDataUtil::GetSMNoteDataString( *m_pNoteData, m_sNoteDataCompressed ); m_uHash = GetHashForString( m_sNoteDataCompressed ); + m_sFilename = EMPTY_STRING; // We can no longer read from the file because it has changed in memory. } void Steps::GetNoteData( NoteData& noteDataOut ) const { - ASSERT(this); - Decompress(); if( m_bNoteDataIsFilled ) @@ -89,6 +88,7 @@ void Steps::SetSMNoteData( const RString ¬es_comp_ ) m_sNoteDataCompressed = notes_comp_; m_uHash = GetHashForString( m_sNoteDataCompressed ); + m_sFilename = EMPTY_STRING; // We can no longer read from the file because it has changed in memory. } /* XXX: this function should pull data from m_sFilename, like Decompress() */