mirror of
https://gitlab.com/Mr_Goldberg/goldberg_emulator.git
synced 2024-11-23 20:38:07 +01:00
Don't overwrite achievement date
Don't overwrite achievement date when setting the achievement and it was already set.
This commit is contained in:
parent
7ce278fc47
commit
c60a763f68
1 changed files with 1 additions and 1 deletions
|
@ -249,7 +249,7 @@ bool SetAchievement( const char *pchName )
|
||||||
auto it = std::find_if(defined_achievements.begin(), defined_achievements.end(), [pchName](nlohmann::json& item) {
|
auto it = std::find_if(defined_achievements.begin(), defined_achievements.end(), [pchName](nlohmann::json& item) {
|
||||||
return item["name"].get<std::string>() == pchName;
|
return item["name"].get<std::string>() == 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"] = true;
|
||||||
user_achievements[pchName]["earned_time"] = static_cast<uint32>(std::time(nullptr));
|
user_achievements[pchName]["earned_time"] = static_cast<uint32>(std::time(nullptr));
|
||||||
return true;
|
return true;
|
||||||
|
|
Loading…
Reference in a new issue