From 4fbc0692f80afc6ac1c6108fda2a4e7ecf06558b Mon Sep 17 00:00:00 2001 From: Spartan322 Date: Fri, 30 Aug 2024 21:32:06 -0400 Subject: Fix handling empty `vic2_steam_lib_directory` --- src/openvic-simulation/dataloader/Vic2PathSearch.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'src/openvic-simulation/dataloader/Vic2PathSearch.cpp') diff --git a/src/openvic-simulation/dataloader/Vic2PathSearch.cpp b/src/openvic-simulation/dataloader/Vic2PathSearch.cpp index ccd55d1..a23d0ce 100644 --- a/src/openvic-simulation/dataloader/Vic2PathSearch.cpp +++ b/src/openvic-simulation/dataloader/Vic2PathSearch.cpp @@ -1,3 +1,5 @@ +#include + #include #include @@ -159,7 +161,7 @@ static fs::path _search_for_game_path(fs::path hint_path = {}) { // Steam Library's directory that will contain Victoria 2 fs::path vic2_steam_lib_directory; - fs::path current_path = hint_path; + fs::path current_path = std::filesystem::weakly_canonical(hint_path, error_code); // If hinted path is directory that contains steamapps bool is_steamapps = false; @@ -288,7 +290,7 @@ static fs::path _search_for_game_path(fs::path hint_path = {}) { // If we could not confirm Victoria 2 was installed via the default Steam installation bool is_common_folder = false; - if (!vic2_install_confirmed) { + if (!vic2_install_confirmed && !vic2_steam_lib_directory.empty()) { auto parser = lexy_vdf::Parser::from_file(vic2_steam_lib_directory); if (!parser.parse()) { // Could not find or load appmanifest_42960.acf, report error as warning -- cgit v1.2.3-56-ga3b1