From b9e577ffbaf18c0826fbb29fd95f9129f6a43161 Mon Sep 17 00:00:00 2001 From: Matt Haynie Date: Sat, 9 Jan 2021 13:30:02 -0800 Subject: [PATCH] Instead of adding the legacy path to the search directory, just copy everything to the new folder and delete the old one. --- tf2_bot_detector/Filesystem.cpp | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/tf2_bot_detector/Filesystem.cpp b/tf2_bot_detector/Filesystem.cpp index f0f7a7a0..0ef38281 100644 --- a/tf2_bot_detector/Filesystem.cpp +++ b/tf2_bot_detector/Filesystem.cpp @@ -102,8 +102,12 @@ void Filesystem::Init() legacyPath /= APPDATA_SUBFOLDER; if (std::filesystem::exists(legacyPath)) { - Log("Found legacy appdata folder {}, adding to search paths...", legacyPath); - m_SearchPaths.push_back(legacyPath); + Log("Found legacy appdata folder {}, copying to {}...", legacyPath, m_RoamingAppDataDir); + std::filesystem::copy(legacyPath, m_RoamingAppDataDir, + std::filesystem::copy_options::recursive | std::filesystem::copy_options::skip_existing); + + Log("Copy complete. Deleting {}...", legacyPath); + std::filesystem::remove_all(legacyPath); } }