diff --git a/stepmania/src/RageFileManager.cpp b/stepmania/src/RageFileManager.cpp index d07d02f5f1..e7e0beebc5 100644 --- a/stepmania/src/RageFileManager.cpp +++ b/stepmania/src/RageFileManager.cpp @@ -281,7 +281,7 @@ bool RageFileManager::Remove( CString sPath ) continue; bool ret = g_Drivers[i].driver->Remove( p ); - if( !ret ) + if( ret ) Deleted = true; } @@ -295,9 +295,13 @@ void RageFileManager::CreateDir( CString sDir ) f.Open( sTempFile, RageFile::WRITE ); f.Close(); - FILEMAN->Remove( sTempFile ); + // YUCK: The dir cache doesn't have this new file we just created, + // so the delete will fail unless we flush. + FILEMAN->FlushDirCache( sDir ); + FILEMAN->Remove( sTempFile ); } + void RageFileManager::Mount( CString Type, CString Root, CString MountPoint ) { LockMut( *g_Mutex ); diff --git a/stepmania/src/StepMania.cpp b/stepmania/src/StepMania.cpp index a4dd22ccca..45b11ab442 100644 --- a/stepmania/src/StepMania.cpp +++ b/stepmania/src/StepMania.cpp @@ -1309,8 +1309,8 @@ bool HandleGlobalInputs( DeviceInput DeviceI, InputEventType type, GameInput Gam BOOKKEEPER->WriteToDisk(); PROFILEMAN->SaveMachineProfile(); FOREACH_PlayerNumber( p ) - if( PROFILEMAN->IsUsingProfile((PlayerNumber)p) ) - PROFILEMAN->SaveProfile( (PlayerNumber)p ); + if( PROFILEMAN->IsUsingProfile(p) ) + PROFILEMAN->SaveProfile( p ); SCREENMAN->SystemMessage( "Stats saved" ); } else