diff options
author | Ta180m | 2020-04-24 15:26:37 -0500 |
---|---|---|
committer | GitHub | 2020-04-24 15:26:37 -0500 |
commit | 058540bdfb1d217257abab3329eacc10e5b6c6f3 (patch) | |
tree | 8bf57fad374a9c1b2e7109eec6a3993cd106ecf2 | |
parent | 933c95027eb263b5c22dfc4a4aec2fa45ef0fa71 (diff) |
Update main.cpp
Updated save path
-rw-r--r-- | arm9/source/main.cpp | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/arm9/source/main.cpp b/arm9/source/main.cpp index b344fe6..f81f55c 100644 --- a/arm9/source/main.cpp +++ b/arm9/source/main.cpp @@ -9,6 +9,7 @@ #include <vector> #include <unistd.h> #include <fat.h> +#include <algorithm> #include "file_browse.h" #include "headers.h" @@ -205,7 +206,10 @@ void CreateForwarder() { if(bootstrap_template.HasFileHandle()) { bootsrtapconfig.SaveFile(folderpath + "/data/config.ini"); bootstrap_template.SetValue("NDS-BOOTSTRAP", "NDS_PATH", file.c_str()); - std::string savePath = ReplaceAll(file, ".nds", ".sav"); + std::string save = file; + auto it = std::find(save.rbegin(), save.rend(), '/'); + save.insert(save.rend() - it, "saves/"); + std::string savePath = ReplaceAll(save, ".nds", ".sav"); bootstrap_template.SetValue("NDS-BOOTSTRAP", "SAV_PATH", savePath.c_str()); bootstrap_template.SaveFile(folderpath + "/data/bootstrap.ini"); } |