From 6e068d893d392310843f800cca1d428c5054199f Mon Sep 17 00:00:00 2001 From: Keatzee Date: Thu, 27 Jul 2017 13:16:31 -0400 Subject: [PATCH] Move autosaves to a subfolder of /save, closes #3209 --- src/openrct2/game.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/openrct2/game.c b/src/openrct2/game.c index a72dcc27bc..3e0bd02642 100644 --- a/src/openrct2/game.c +++ b/src/openrct2/game.c @@ -1276,9 +1276,11 @@ static void limit_autosave_count(const size_t numberOfFilesToKeep, bool processL if (processLandscapeFolder) { platform_get_user_directory(filter, "landscape", sizeof(filter)); + safe_strcat_path(filter, "autosave", sizeof(filter)); safe_strcat_path(filter, "autosave_*.sc6", sizeof(filter)); } else { platform_get_user_directory(filter, "save", sizeof(filter)); + safe_strcat_path(filter, "autosave", sizeof(filter)); safe_strcat_path(filter, "autosave_*.sv6", sizeof(filter)); } @@ -1307,6 +1309,7 @@ static void limit_autosave_count(const size_t numberOfFilesToKeep, bool processL } else { platform_get_user_directory(autosaveFiles[i], "save", sizeof(utf8) * MAX_PATH); } + safe_strcat_path(autosaveFiles[i], "autosave", sizeof(utf8) * MAX_PATH); safe_strcat_path(autosaveFiles[i], fileInfo.path, sizeof(utf8) * MAX_PATH); } } @@ -1360,6 +1363,8 @@ void game_autosave() utf8 path[MAX_PATH]; utf8 backupPath[MAX_PATH]; platform_get_user_directory(path, subDirectory, sizeof(path)); + safe_strcat_path(path, "autosave", sizeof(path)); + platform_ensure_directory_exists(path); safe_strcpy(backupPath, path, sizeof(backupPath)); safe_strcat_path(path, timeName, sizeof(path)); safe_strcat_path(backupPath, "autosave", sizeof(backupPath));