diff options
author | Spartan322 <Megacake1234@gmail.com> | 2024-08-31 03:32:06 +0200 |
---|---|---|
committer | Spartan322 <Megacake1234@gmail.com> | 2024-08-31 03:32:06 +0200 |
commit | 4fbc0692f80afc6ac1c6108fda2a4e7ecf06558b (patch) | |
tree | f18cbfe1a9a1ee45134470b51f7be0d3e9f373ff /src/openvic-simulation | |
parent | adc7eb8ad07170ba8da18f684321a92d01447c2c (diff) |
Fix handling empty `vic2_steam_lib_directory`fix/lexy-vdf-parse-error
Diffstat (limited to 'src/openvic-simulation')
-rw-r--r-- | src/openvic-simulation/dataloader/Vic2PathSearch.cpp | 6 |
1 files changed, 4 insertions, 2 deletions
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 <filesystem> + #include <openvic-dataloader/detail/CallbackOStream.hpp> #include <lexy-vdf/KeyValues.hpp> @@ -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 |