From 5c320bab1209703c865f0d8c2887e15bb4b931a1 Mon Sep 17 00:00:00 2001 From: Garry Newman Date: Sun, 2 Apr 2017 10:33:35 +0100 Subject: [PATCH] Changed AddScore to reflect the real functionality --- Facepunch.Steamworks/Client/Leaderboard.cs | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/Facepunch.Steamworks/Client/Leaderboard.cs b/Facepunch.Steamworks/Client/Leaderboard.cs index f2c2551..8bfe99b 100644 --- a/Facepunch.Steamworks/Client/Leaderboard.cs +++ b/Facepunch.Steamworks/Client/Leaderboard.cs @@ -93,18 +93,18 @@ namespace Facepunch.Steamworks } /// - /// Add a score to this leaderboard. - /// Subscores are totally optional, and can be used for other game defined data such as laps etc.. although - /// they have no bearing on sorting at all. + /// Add a score to this leaderboard. + /// Subscores are totally optional, and can be used for other game defined data such as laps etc.. although + /// they have no bearing on sorting at all + /// If onlyIfBeatsOldScore is true, the score will only be updated if it beats the existing score, else it will always + /// be updated. /// - public void AddScore( bool replaceOldScore, bool onlyIfBeatsOldScore, int score, params int[] subscores ) + public void AddScore( bool onlyIfBeatsOldScore, int score, params int[] subscores ) { if ( !IsValid ) return; - var flags = LeaderboardUploadScoreMethod.None; - - if ( replaceOldScore ) flags |= LeaderboardUploadScoreMethod.ForceUpdate; - if ( onlyIfBeatsOldScore ) flags |= LeaderboardUploadScoreMethod.KeepBest; + var flags = LeaderboardUploadScoreMethod.ForceUpdate; + if ( onlyIfBeatsOldScore ) flags = LeaderboardUploadScoreMethod.KeepBest; client.native.userstats.UploadLeaderboardScore( BoardId, flags, score, subscores, subscores.Length ); }