mirror of
https://gitlab.com/Mr_Goldberg/goldberg_emulator.git
synced 2024-11-23 20:38:07 +01:00
Properly handle leaderboard name being NULL (#167)
This commit is contained in:
parent
f041b95c86
commit
c5f50ddb32
1 changed files with 12 additions and 0 deletions
|
@ -591,6 +591,12 @@ SteamAPICall_t FindOrCreateLeaderboard( const char *pchLeaderboardName, ELeaderb
|
||||||
{
|
{
|
||||||
PRINT_DEBUG("FindOrCreateLeaderboard %s\n", pchLeaderboardName);
|
PRINT_DEBUG("FindOrCreateLeaderboard %s\n", pchLeaderboardName);
|
||||||
std::lock_guard<std::recursive_mutex> lock(global_mutex);
|
std::lock_guard<std::recursive_mutex> lock(global_mutex);
|
||||||
|
if (!pchLeaderboardName) {
|
||||||
|
LeaderboardFindResult_t data;
|
||||||
|
data.m_hSteamLeaderboard = 0;
|
||||||
|
data.m_bLeaderboardFound = 0;
|
||||||
|
return callback_results->addCallResult(data.k_iCallback, &data, sizeof(data));
|
||||||
|
}
|
||||||
|
|
||||||
unsigned int leader = find_leaderboard(pchLeaderboardName);
|
unsigned int leader = find_leaderboard(pchLeaderboardName);
|
||||||
if (!leader) {
|
if (!leader) {
|
||||||
|
@ -616,6 +622,12 @@ SteamAPICall_t FindLeaderboard( const char *pchLeaderboardName )
|
||||||
{
|
{
|
||||||
PRINT_DEBUG("FindLeaderboard %s\n", pchLeaderboardName);
|
PRINT_DEBUG("FindLeaderboard %s\n", pchLeaderboardName);
|
||||||
std::lock_guard<std::recursive_mutex> lock(global_mutex);
|
std::lock_guard<std::recursive_mutex> lock(global_mutex);
|
||||||
|
if (!pchLeaderboardName) {
|
||||||
|
LeaderboardFindResult_t data;
|
||||||
|
data.m_hSteamLeaderboard = 0;
|
||||||
|
data.m_bLeaderboardFound = 0;
|
||||||
|
return callback_results->addCallResult(data.k_iCallback, &data, sizeof(data));
|
||||||
|
}
|
||||||
|
|
||||||
auto settings_Leaderboards = settings->getLeaderboards();
|
auto settings_Leaderboards = settings->getLeaderboards();
|
||||||
if (settings_Leaderboards.count(pchLeaderboardName)) {
|
if (settings_Leaderboards.count(pchLeaderboardName)) {
|
||||||
|
|
Loading…
Reference in a new issue