mirror of
https://github.com/OpenRCT2/OpenRCT2
synced 2026-01-04 13:42:55 +01:00
Replace deprecated function call
This commit is contained in:
@@ -686,16 +686,17 @@ static void limit_autosave_count(const size_t numberOfFilesToKeep, bool processL
|
||||
size_t autosavesCount = 0;
|
||||
size_t numAutosavesToDelete = 0;
|
||||
|
||||
char const* folderDirectory = "save";
|
||||
auto environment = GetContext()->GetPlatformEnvironment();
|
||||
auto folderDirectory = environment->GetDirectoryPath(DIRBASE::USER, DIRID::SAVE);
|
||||
char const* fileFilter = "autosave_*.sv6";
|
||||
if (processLandscapeFolder)
|
||||
{
|
||||
folderDirectory = "landscape";
|
||||
folderDirectory = environment->GetDirectoryPath(DIRBASE::USER, DIRID::LANDSCAPE);
|
||||
fileFilter = "autosave_*.sc6";
|
||||
}
|
||||
|
||||
utf8 filter[MAX_PATH];
|
||||
safe_strcpy(filter, folderDirectory, sizeof(filter));
|
||||
safe_strcpy(filter, folderDirectory.c_str(), sizeof(filter));
|
||||
safe_strcat_path(filter, "autosave", sizeof(filter));
|
||||
safe_strcat_path(filter, fileFilter, sizeof(filter));
|
||||
|
||||
@@ -722,7 +723,7 @@ static void limit_autosave_count(const size_t numberOfFilesToKeep, bool processL
|
||||
autosaveFiles[i].resize(MAX_PATH, 0);
|
||||
if (scanner->Next())
|
||||
{
|
||||
platform_get_user_directory(autosaveFiles[i].data(), folderDirectory, sizeof(utf8) * MAX_PATH);
|
||||
platform_get_user_directory(autosaveFiles[i].data(), folderDirectory.c_str(), sizeof(utf8) * MAX_PATH);
|
||||
safe_strcat_path(autosaveFiles[i].data(), "autosave", sizeof(utf8) * MAX_PATH);
|
||||
safe_strcat_path(autosaveFiles[i].data(), scanner->GetPathRelative(), sizeof(utf8) * MAX_PATH);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user