mirror of
https://github.com/Detanup01/gbe_fork.git
synced 2025-03-28 14:56:24 +01:00
avoid a scenario where progress might exist but not max_progress is user data
This commit is contained in:
parent
2bea12e199
commit
6bf45a35e2
1 changed files with 5 additions and 2 deletions
|
@ -774,8 +774,11 @@ Steam_User_Stats::Steam_User_Stats(Settings *settings, class Networking *network
|
|||
user_ach.emplace("earned_time", static_cast<uint32>(0));
|
||||
// they will throw an exception for achievements with no progress
|
||||
try {
|
||||
user_ach.emplace("progress", std::stof(trig.min_value));
|
||||
user_ach.emplace("max_progress", std::stof(trig.max_value));
|
||||
uint32 progress_min = std::stoul(trig.min_value);
|
||||
uint32 progress_max = std::stoul(trig.max_value);
|
||||
// if the above lines didn't throw exception then add the values
|
||||
user_ach.emplace("progress", progress_min);
|
||||
user_ach.emplace("max_progress", progress_max);
|
||||
} catch(...) {}
|
||||
} catch(...) {}
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue