mirror of
https://github.com/coop-deluxe/sm64coopdx.git
synced 2024-12-22 08:20:22 +00:00
quick patch: don't rename tmp folder if .tmp already exists (#48)
if ex-coop is ran after the tmp folder is renamed, a new tmp folder will be created, which coopdx will then attempt to rename on the next run and fail to do so since .tmp already exists, resulting in the game failing to open
This commit is contained in:
parent
f5db61f864
commit
bb34e9f501
1 changed files with 3 additions and 2 deletions
|
@ -38,11 +38,12 @@ static struct VanillaMD5 sVanillaMD5[] = {
|
|||
inline static void rename_tmp_folder() {
|
||||
std::string userPath = fs_get_write_path("");
|
||||
std::string oldPath = userPath + "tmp";
|
||||
if (fs::exists(oldPath)) {
|
||||
std::string newPath = userPath + TMP_DIRECTORY;
|
||||
if (fs::exists(oldPath) && !fs::exists(newPath)) {
|
||||
#if defined(_WIN32) || defined(_WIN64)
|
||||
SetFileAttributesA(oldPath.c_str(), FILE_ATTRIBUTE_HIDDEN);
|
||||
#endif
|
||||
fs::rename(oldPath, userPath + TMP_DIRECTORY);
|
||||
fs::rename(oldPath, newPath);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue