From 3b01937b19dac1f5b904da4210c078af836f86f1 Mon Sep 17 00:00:00 2001 From: Plokie <80136737+Plokie@users.noreply.github.com> Date: Sun, 11 Feb 2024 21:19:49 +0000 Subject: [PATCH] create worlds folder if doesnt exist --- Game/TitleScreen.cpp | 8 ++++++++ Worlds/shadowtest/world.dat | 2 +- 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/Game/TitleScreen.cpp b/Game/TitleScreen.cpp index 3f4840b..56c5f9c 100644 --- a/Game/TitleScreen.cpp +++ b/Game/TitleScreen.cpp @@ -11,8 +11,16 @@ #include #include #include +#include void GetSubdirectories(vector* 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); diff --git a/Worlds/shadowtest/world.dat b/Worlds/shadowtest/world.dat index 44c553b..f4f48f9 100644 --- a/Worlds/shadowtest/world.dat +++ b/Worlds/shadowtest/world.dat @@ -213,7 +213,7 @@ "oxygen": 20, "position": [ -49.840213775634766, - 2.5199999809265137, + 2.572800397872925, -17.113903045654297 ], "saturation": 10,