git repos / blockattack-game

commit 05bf8131

Poul Sander · 2022-02-15 13:35
05bf8131de5e7cad4e8a450bc5f0ffddace317c9 patch · browse files
parent 877e52e0fa65f8612d3d8cb9ba5785face917274

Do not fail on folder already existing

Changed files

M source/code/os.cpp before
diff --git a/source/code/os.cpp b/source/code/os.cpp index 4adf8e0..e03b00f 100644 --- a/source/code/os.cpp +++ b/source/code/os.cpp
@@ -122,7 +122,7 @@ void OsCreateFolder(const std::string& path) {
#if defined(_WIN32)
//Now for Windows Vista+
int retcode = SHCreateDirectoryExW(NULL, win32_utf8_to_utf16(path.c_str()).c_str(), NULL);
- if (retcode != ERROR_SUCCESS) {
+ if (retcode != ERROR_SUCCESS && retcode != ERROR_FILE_EXISTS && retcode != ERROR_ALREADY_EXISTS) {
std::cerr << "Failed to create: " << path+"/" << "\n";
}
#else