diff --git a/stepmania/src/SongManager.cpp b/stepmania/src/SongManager.cpp index 29d1357ac5..8c9026ba51 100644 --- a/stepmania/src/SongManager.cpp +++ b/stepmania/src/SongManager.cpp @@ -811,6 +811,17 @@ void SongManager::DeleteCourse( Course *pCourse ) RefreshCourseGroupInfo(); } +void SongManager::InvalidateCachedTrails() +{ + FOREACH_CONST( Course *, m_pCourses, pCourse ) + { + const Course &c = **pCourse; + + if( c.IsAnEdit() ) + c.m_TrailCache.clear(); + } +} + /* Called periodically to wipe out cached NoteData. This is called when we change * screens. */ void SongManager::Cleanup() diff --git a/stepmania/src/SongManager.h b/stepmania/src/SongManager.h index e4e4327aec..6c6c9660aa 100644 --- a/stepmania/src/SongManager.h +++ b/stepmania/src/SongManager.h @@ -50,7 +50,7 @@ public: void FreeCourses(); void AddCourse( Course *pCourse ); // transfers ownership of pCourse void DeleteCourse( Course *pCourse ); // transfers ownership of pCourse - + void InvalidateCachedTrails(); void InitAll( LoadingWindow *ld ); // songs, courses, groups - everything. void Reload( bool bAllowFastLoad, LoadingWindow *ld=NULL ); // songs, courses, groups - everything. diff --git a/stepmania/src/UnlockManager.cpp b/stepmania/src/UnlockManager.cpp index f18718a355..bbbb8ce378 100644 --- a/stepmania/src/UnlockManager.cpp +++ b/stepmania/src/UnlockManager.cpp @@ -593,6 +593,7 @@ void UnlockManager::UnlockEntryID( RString sEntryID ) PROFILEMAN->GetProfile(pn)->m_UnlockedEntryIDs.insert( sEntryID ); PROFILEMAN->GetMachineProfile()->m_UnlockedEntryIDs.insert( sEntryID ); + SONGMAN->InvalidateCachedTrails(); } void UnlockManager::UnlockEntryIndex( int iEntryIndex )