Skip to content

Commit

Permalink
fix country in Steam_Apps::GetAppData()
Browse files Browse the repository at this point in the history
  • Loading branch information
a committed Dec 7, 2024
1 parent 0e0df25 commit b9d5052
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions dll/steam_apps.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit b9d5052

Please sign in to comment.