1
0
Fork 0
mirror of https://github.com/Detanup01/gbe_fork.git synced 2025-03-28 14:56:24 +01:00

fix country in Steam_Apps::GetAppData()

This commit is contained in:
a 2024-12-07 06:35:13 +02:00
parent 0e0df256c5
commit b9d50520e4

View file

@ -47,10 +47,10 @@ int Steam_Apps::GetAppData( AppId_t nAppID, const char *pchKey, char *pchValue,
return 2;
} else if (common_helpers::str_cmp_insensitive("country", pchKey)) {
// TODO this is not exactly how real client does it, but close enough
auto lang = GetCurrentGameLanguage();
auto lang_lower = common_helpers::to_lower(lang && lang[0] ? lang : "--"); // "--" is an actual value the client returns
auto country = settings->ip_country.c_str();
auto country_lower = common_helpers::to_lower(country && country[0] ? country : "--"); // "--" is an actual value the client returns
if (pchValue && cchValueMax >= 3) {
strncpy(pchValue, lang_lower.c_str(), 3);
strncpy(pchValue, country_lower.c_str(), 3);
pchValue[2] = 0;
}
return 3;