diff --git a/stepmania/src/RageFileDriverDirect.cpp b/stepmania/src/RageFileDriverDirect.cpp index 30b592c494..ebe73ae1c4 100644 --- a/stepmania/src/RageFileDriverDirect.cpp +++ b/stepmania/src/RageFileDriverDirect.cpp @@ -82,6 +82,15 @@ static int WinMoveFile( const CString sOldPath, const CString sNewPath ) Win9x = true; } + if( MoveFile( sOldPath, sNewPath ) ) + return 1; + + if( GetLastError() != ERROR_ALREADY_EXISTS ) + return 0; + + if( !DeleteFile( sNewPath ) ) + return 0; + return MoveFile( sOldPath, sNewPath ); } #endif