Use `sort_method` when comparing scores in `UploadLeaderboardScore`

Nicolas Gnyra 2023-09-25 22:54:44 -04:00
parent 475342f0d8
commit 6647317b88
1 changed files with 3 additions and 1 deletions

View File

@ -1021,7 +1021,9 @@ SteamAPICall_t UploadLeaderboardScore( SteamLeaderboard_t hSteamLeaderboard, ELe
bool changed = false; bool changed = false;
if (eLeaderboardUploadScoreMethod == k_ELeaderboardUploadScoreMethodKeepBest) { if (eLeaderboardUploadScoreMethod == k_ELeaderboardUploadScoreMethodKeepBest) {
if (leaderboards[hSteamLeaderboard - 1].self_score.score <= score.score) { if (leaderboards[hSteamLeaderboard - 1].sort_method == k_ELeaderboardSortMethodAscending
? leaderboards[hSteamLeaderboard - 1].self_score.score >= score.score
: leaderboards[hSteamLeaderboard - 1].self_score.score <= score.score) {
leaderboards[hSteamLeaderboard - 1].self_score = score; leaderboards[hSteamLeaderboard - 1].self_score = score;
changed = true; changed = true;
} }