windows docs path fix

This commit is contained in:
CatWindow 2026-08-13 15:21:31 +03:00
parent 04a9689320
commit 26fb318f41

View file

@ -253,7 +253,16 @@ Oneshot::Oneshot(RGSSThreadData &threadData) : threadData(threadData){
const char* path = SDL_GetUserFolder(SDL_FOLDER_DOCUMENTS);
p->docsPath = path;
#ifdef windows
p->gamePath = path "\\My Games";
const char* suffix = "\\My Games";
size_t len = std::strlen(path) + std::strlen(suffix) + 1;
p->gamePath = (char*)SDL_malloc(len);
if (p->gamePath) {
std::strcpy(p->gamePath, path);
std::strcat(p->gamePath, suffix);
}
SDL_free((void*)path);
#else
p->gamePath = path;
#endif