From 535285833d85bcfb6226180344277ed1b9ec0577 Mon Sep 17 00:00:00 2001 From: Lock l00p Date: Mon, 3 Jun 2024 22:02:34 +0000 Subject: [PATCH] Create foldername define to allow changing where switch gamedata is stored --- fs.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/fs.c b/fs.c index bbab3b57..81fc6588 100644 --- a/fs.c +++ b/fs.c @@ -25,6 +25,10 @@ #include #include +#ifndef FOLDERNAME +#define FOLERNAME "darkplaces" +#endif + #ifdef WIN32 # include # include @@ -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){ -- 2.39.2