File tree Expand file tree Collapse file tree 1 file changed +8
-6
lines changed
Expand file tree Collapse file tree 1 file changed +8
-6
lines changed Original file line number Diff line number Diff line change @@ -441,11 +441,6 @@ void AddOfficialBeatmapLevelsRepository(BeatmapLevelsRepository levelsRepository
441441 // Clear removed songs from loaded data, in case they were removed manually.
442442 if ( _customLevelLoader . _loadedBeatmapSaveData . Count > 0 )
443443 {
444- if ( ! fullRefresh )
445- {
446- StoreLoadedBeatmapSaveData ( ) ;
447- }
448-
449444 var folders = songFolders
450445 . Concat ( SeparateSongFolders
451446 . Select ( f => Path . GetFullPath ( f . SongFolderEntry . Path ) )
@@ -455,13 +450,20 @@ void AddOfficialBeatmapLevelsRepository(BeatmapLevelsRepository levelsRepository
455450 . Where ( d => d . Exists && ! d . Attributes . HasFlag ( FileAttributes . Hidden ) )
456451 . Select ( d => d . FullName ) ) )
457452 . ToHashSet ( ) ;
458- foreach ( var loadedSaveData in _customLevelLoader . _loadedBeatmapSaveData . Values )
453+
454+ // Need to make a copy of the loaded save data since we might modify the iterated collection.
455+ foreach ( var loadedSaveData in _customLevelLoader . _loadedBeatmapSaveData . Values . ToArray ( ) )
459456 {
460457 if ( ! folders . Contains ( loadedSaveData . customLevelFolderInfo . folderPath ) )
461458 {
462459 DeleteSingleSong ( loadedSaveData . customLevelFolderInfo . folderPath , false ) ;
463460 }
464461 }
462+
463+ if ( ! fullRefresh )
464+ {
465+ StoreLoadedBeatmapSaveData ( ) ;
466+ }
465467 }
466468
467469 Parallel . ForEach ( songFolders , parallelOptions , folder =>
You can’t perform that action at this time.
0 commit comments