aboutsummaryrefslogtreecommitdiff
path: root/NorthstarDedicatedTest/languagehooks.cpp
diff options
context:
space:
mode:
authorBobTheBob <32057864+BobTheBob9@users.noreply.github.com>2022-01-25 18:06:57 +0000
committerBobTheBob <32057864+BobTheBob9@users.noreply.github.com>2022-01-25 18:06:57 +0000
commitfc10ac473811f2497ef3f4c9c0b885f8efb3025f (patch)
treec4af81b026e6d72b79d1b11e939e04183ece4b84 /NorthstarDedicatedTest/languagehooks.cpp
parent32277386b62877999c2017146750a2449d52d447 (diff)
parenta23232aad6bccc3dc0e5ecd38365303863222a73 (diff)
downloadNorthstarLauncher-fc10ac473811f2497ef3f4c9c0b885f8efb3025f.tar.gz
NorthstarLauncher-fc10ac473811f2497ef3f4c9c0b885f8efb3025f.zip
Merge branch 'main' of https://github.com/R2Northstar/NorthstarLauncher
Diffstat (limited to 'NorthstarDedicatedTest/languagehooks.cpp')
-rw-r--r--NorthstarDedicatedTest/languagehooks.cpp8
1 files changed, 6 insertions, 2 deletions
diff --git a/NorthstarDedicatedTest/languagehooks.cpp b/NorthstarDedicatedTest/languagehooks.cpp
index 0929b73d..3a69df9d 100644
--- a/NorthstarDedicatedTest/languagehooks.cpp
+++ b/NorthstarDedicatedTest/languagehooks.cpp
@@ -26,6 +26,9 @@ std::vector<std::string> file_list(fs::path dir, std::regex ext_pattern)
{
std::vector<std::string> result;
+ if (!fs::exists(dir) || !fs::is_directory(dir))
+ return result;
+
using iterator = fs::directory_iterator;
const iterator end;
@@ -77,7 +80,8 @@ char* GetGameLanguageHook()
auto lang = GetGameLanguageOriginal();
if (!CheckLangAudioExists(lang))
{
- spdlog::info("Origin detected language \"{}\", but we do not have audio for it installed, falling back to the next option", lang);
+ if (strcmp(lang, "russian") != 0) // don't log for "russian" since it's the default and that means Origin detection just didn't change it most likely
+ spdlog::info("Origin detected language \"{}\", but we do not have audio for it installed, falling back to the next option", lang);
}
else
@@ -95,7 +99,7 @@ char* GetGameLanguageHook()
{
spdlog::warn("Caution, audio for this language does NOT exist. You might want to override your game language with -language command line option.");
auto lang = GetAnyInstalledAudioLanguage();
- spdlog::warn("Falling back to first installed audio language: {}", lang.c_str());
+ spdlog::warn("Falling back to the first installed audio language: {}", lang.c_str());
strncpy(ingameLang1, lang.c_str(), 256);
return ingameLang1;
}