Skip to content

Commit

Permalink
create worlds folder if doesnt exist
Browse files Browse the repository at this point in the history
  • Loading branch information
Plokie committed Feb 11, 2024
1 parent 868fb31 commit 3b01937
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
8 changes: 8 additions & 0 deletions Game/TitleScreen.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,16 @@
#include <tchar.h>
#include <string>
#include <locale>
#include <direct.h>

void GetSubdirectories(vector<wstring>* outVec) {
struct stat info;
stat("Worlds", &info); //get info on a Worlds folder

if(!(info.st_mode & S_IFDIR)) { // if folder doesnt exit
int ret = _mkdir("Worlds"); // create Worlds folder
}

WIN32_FIND_DATA findFileData;
HANDLE hFind = FindFirstFile(L"Worlds\\*", &findFileData);

Expand Down
2 changes: 1 addition & 1 deletion Worlds/shadowtest/world.dat
Original file line number Diff line number Diff line change
Expand Up @@ -213,7 +213,7 @@
"oxygen": 20,
"position": [
-49.840213775634766,
2.5199999809265137,
2.572800397872925,
-17.113903045654297
],
"saturation": 10,
Expand Down

0 comments on commit 3b01937

Please sign in to comment.