Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 12 additions & 2 deletions src/Network/Resources.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -579,7 +579,12 @@ void NewSyncResources(SOCKET Sock, const std::string& Mods, const std::vector<Mo
}
#endif

fs::copy_file(PathToSaveTo, std::filesystem::path(GetGamePath()) / "mods/multiplayer" / FName, fs::copy_options::overwrite_existing);
auto name = std::filesystem::path(GetGamePath()) / "mods/multiplayer" / FName;
auto tmp_name = name;
tmp_name += ".tmp";

fs::copy_file(PathToSaveTo, tmp_name, fs::copy_options::overwrite_existing);
fs::rename(tmp_name, name);
UpdateModUsage(FName);
}
WaitForConfirm();
Expand Down Expand Up @@ -738,7 +743,12 @@ void SyncResources(SOCKET Sock) {
}
#endif

fs::copy_file(PathToSaveTo, GetGamePath() / beammp_wide("mods/multiplayer") / Utils::ToWString(FName), fs::copy_options::overwrite_existing);
auto name = GetGamePath() / beammp_wide("mods/multiplayer") / Utils::ToWString(FName);
auto tmp_name = name;
tmp_name += L".tmp";

fs::copy_file(PathToSaveTo, tmp_name, fs::copy_options::overwrite_existing);
fs::rename(tmp_name, name);
UpdateModUsage(FN->substr(pos));
}
WaitForConfirm();
Expand Down
Loading