]> git.rm.cloudns.org Git - xonotic/darkplaces.git/commitdiff
Create foldername define to allow changing where switch gamedata is stored Lockl00p/switch-support
authorLock l00p <hakzstudios@gmail.com>
Mon, 3 Jun 2024 22:02:34 +0000 (22:02 +0000)
committerLock l00p <hakzstudios@gmail.com>
Mon, 3 Jun 2024 22:02:34 +0000 (22:02 +0000)
fs.c

diff --git a/fs.c b/fs.c
index bbab3b57a25bf46516f88957e5a9636ed26d83d8..81fc6588949aa3a038592fe653f359ed9bbad20e 100644 (file)
--- a/fs.c
+++ b/fs.c
 #include <limits.h>
 #include <fcntl.h>
 
+#ifndef FOLDERNAME
+#define FOLERNAME "darkplaces"
+#endif
+
 #ifdef WIN32
 # include <direct.h>
 # include <io.h>
@@ -2207,7 +2211,7 @@ static void FS_Init_Dir (void)
        accountGetProfile(&profile, userID);
        accountProfileGet(&profile,NULL,&profileBase);
 
-       dpsnprintf(fs_basedir, sizeof(fs_basedir), "/switch/darkplaces/%s",profileBase.nickname);
+       dpsnprintf(fs_basedir, sizeof(fs_basedir), "/switch/%s/%s",FOLDERNAME,profileBase.nickname);
        //No idea why I need to make this weird struct to use stat but stackoverflow decreed I must, so I shall.
        struct stat sb;
        if(stat(fs_basedir,&sb) == -1){