Skip to content

Commit

Permalink
check for mods directory
Browse files Browse the repository at this point in the history
  • Loading branch information
Lukas Beyer committed May 27, 2024
1 parent ce9bb49 commit 6e7dfe4
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/mod_loader.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,11 @@ void ModLoader::LoadMods() {
directory = std::string(buffer).substr(0, pos) + "\\" + directory;
}

DWORD ftyp = GetFileAttributesA(directory.c_str());
if(ftyp == INVALID_FILE_ATTRIBUTES){
printf("creating mods directory\n");
CreateDirectoryA((LPCSTR)directory.c_str(), NULL);
}
for (const auto& entry : std::filesystem::directory_iterator(directory)) {
if (entry.is_regular_file()) { // is regular file
std::string filePath = entry.path().string();
Expand Down

0 comments on commit 6e7dfe4

Please sign in to comment.