diff --git a/src/UESaveFile/UESaveFile.cpp b/src/UESaveFile/UESaveFile.cpp index 115d3ad..39728b7 100644 --- a/src/UESaveFile/UESaveFile.cpp +++ b/src/UESaveFile/UESaveFile.cpp @@ -128,13 +128,12 @@ auto UESaveFile::saveToFile() -> bool { return false; } - if(!Utility::Path::remove(_filepath)) { + if(!Utility::Path::copy(_filepath + ".tmp"_s, _filepath)) { + Utility::Path::copy(_filepath + ".bak"_s, _filepath); return false; } - - if(!Utility::Path::move(_filepath + ".tmp"_s, _filepath)) { - Utility::Path::move(_filepath + ".bak"_s, _filepath); - return false; + else { + Utility::Path::remove(_filepath + ".tmp"_s); } _noReloadAfterSave = true;