Properly initialize user_achievements so functions like

getachievementandunlocktime work properly.
merge-requests/38/merge
Mr_Goldberg 2021-02-28 19:26:29 -05:00
parent 58a57cc91b
commit 992e5c3faa
No known key found for this signature in database
GPG Key ID: 8597D87419DEF278
1 changed files with 10 additions and 0 deletions

View File

@ -94,6 +94,16 @@ Steam_User_Stats(Settings *settings, Local_Storage *local_storage, class SteamCa
{
load_achievements_db(); // achievements db
load_achievements(); // achievements per user
for (auto & it : defined_achievements) {
try {
std::string name = static_cast<std::string const&>(it["name"]);
if (user_achievements.find(name) == user_achievements.end()) {
user_achievements[name]["earned"] = false;
user_achievements[name]["earned_time"] = static_cast<uint32>(0);
}
} catch (...) {}
}
}
// Ask the server to send down this user's data and achievements for this game