From c60a763f68f7ac961f5e653639dd2a7b02ad0eb0 Mon Sep 17 00:00:00 2001 From: Nemirtingas Date: Thu, 10 Oct 2019 23:13:21 +0200 Subject: [PATCH] Don't overwrite achievement date Don't overwrite achievement date when setting the achievement and it was already set. --- dll/steam_user_stats.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dll/steam_user_stats.h b/dll/steam_user_stats.h index eee3247..811008b 100644 --- a/dll/steam_user_stats.h +++ b/dll/steam_user_stats.h @@ -249,7 +249,7 @@ bool SetAchievement( const char *pchName ) auto it = std::find_if(defined_achievements.begin(), defined_achievements.end(), [pchName](nlohmann::json& item) { return item["name"].get() == pchName; }); - if (it != defined_achievements.end()) { + if (it != defined_achievements.end() && user_achievements[pchName]["earned"] == false) { user_achievements[pchName]["earned"] = true; user_achievements[pchName]["earned_time"] = static_cast(std::time(nullptr)); return true;