From 6647317b8844026b564c62ce4917289b7cff8e7b Mon Sep 17 00:00:00 2001 From: Nicolas Gnyra Date: Mon, 25 Sep 2023 22:54:44 -0400 Subject: [PATCH] Use `sort_method` when comparing scores in `UploadLeaderboardScore` --- dll/steam_user_stats.h | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/dll/steam_user_stats.h b/dll/steam_user_stats.h index 4ff4163..73a1fb8 100644 --- a/dll/steam_user_stats.h +++ b/dll/steam_user_stats.h @@ -1021,7 +1021,9 @@ SteamAPICall_t UploadLeaderboardScore( SteamLeaderboard_t hSteamLeaderboard, ELe bool changed = false; 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; changed = true; }