mirror of
https://github.com/Detanup01/gbe_fork.git
synced 2024-12-27 19:04:19 +08:00
minor fix for Steam_User_Stats::FindLeaderboard()
This commit is contained in:
parent
574b8c411e
commit
fa0041db0c
@ -318,12 +318,11 @@ SteamAPICall_t Steam_User_Stats::FindLeaderboard( const char *pchLeaderboardName
|
|||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
std::string name_lower(common_helpers::ascii_to_lowercase(pchLeaderboardName));
|
std::string board_name(pchLeaderboardName);
|
||||||
const auto &settings_Leaderboards = settings->getLeaderboards();
|
const auto &settings_Leaderboards = settings->getLeaderboards();
|
||||||
auto it = settings_Leaderboards.begin();
|
auto it = std::find_if(settings_Leaderboards.begin(), settings_Leaderboards.end(), [&board_name](const std::pair<const std::string, Leaderboard_config> &item){
|
||||||
for (; settings_Leaderboards.end() != it; ++it) {
|
return common_helpers::str_cmp_insensitive(item.first, board_name);
|
||||||
if (common_helpers::str_cmp_insensitive(it->first, name_lower)) break;
|
});
|
||||||
}
|
|
||||||
if (settings_Leaderboards.end() != it) {
|
if (settings_Leaderboards.end() != it) {
|
||||||
auto &config = it->second;
|
auto &config = it->second;
|
||||||
return FindOrCreateLeaderboard(pchLeaderboardName, config.sort_method, config.display_type);
|
return FindOrCreateLeaderboard(pchLeaderboardName, config.sort_method, config.display_type);
|
||||||
@ -331,7 +330,7 @@ SteamAPICall_t Steam_User_Stats::FindLeaderboard( const char *pchLeaderboardName
|
|||||||
return FindOrCreateLeaderboard(pchLeaderboardName, k_ELeaderboardSortMethodDescending, k_ELeaderboardDisplayTypeNumeric);
|
return FindOrCreateLeaderboard(pchLeaderboardName, k_ELeaderboardSortMethodDescending, k_ELeaderboardDisplayTypeNumeric);
|
||||||
} else {
|
} else {
|
||||||
LeaderboardFindResult_t data{};
|
LeaderboardFindResult_t data{};
|
||||||
data.m_hSteamLeaderboard = find_cached_leaderboard(name_lower);
|
data.m_hSteamLeaderboard = find_cached_leaderboard(board_name);
|
||||||
data.m_bLeaderboardFound = !!data.m_hSteamLeaderboard;
|
data.m_bLeaderboardFound = !!data.m_hSteamLeaderboard;
|
||||||
auto ret = callback_results->addCallResult(data.k_iCallback, &data, sizeof(data));
|
auto ret = callback_results->addCallResult(data.k_iCallback, &data, sizeof(data));
|
||||||
callbacks->addCBResult(data.k_iCallback, &data, sizeof(data));
|
callbacks->addCBResult(data.k_iCallback, &data, sizeof(data));
|
||||||
|
Loading…
x
Reference in New Issue
Block a user