Fix Multiple Install Folders (#1328)

* attempt to fix pr

* clang format
This commit is contained in:
ElBread3 2024-10-10 09:52:20 -05:00 committed by GitHub
parent 0a12ba4120
commit 299a29e243
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 48 additions and 10 deletions

View file

@ -534,7 +534,12 @@ void load(const std::filesystem::path& path) {
const auto install_dir_array =
toml::find_or<std::vector<std::string>>(gui, "installDirs", {});
for (const auto& dir : install_dir_array) {
settings_install_dirs.emplace_back(std::filesystem::path{dir});
bool not_already_included =
std::find(settings_install_dirs.begin(), settings_install_dirs.end(), dir) ==
settings_install_dirs.end();
if (not_already_included) {
settings_install_dirs.emplace_back(std::filesystem::path{dir});
}
}
settings_addon_install_dir = toml::find_fs_path_or(gui, "addonInstallDir", {});