mirror of
https://github.com/Detanup01/gbe_fork.git
synced 2024-11-27 05:04:01 +08:00
avoid a scenario where progress might exist but not max_progress is user data
This commit is contained in:
parent
2bea12e199
commit
6bf45a35e2
@ -774,8 +774,11 @@ Steam_User_Stats::Steam_User_Stats(Settings *settings, class Networking *network
|
|||||||
user_ach.emplace("earned_time", static_cast<uint32>(0));
|
user_ach.emplace("earned_time", static_cast<uint32>(0));
|
||||||
// they will throw an exception for achievements with no progress
|
// they will throw an exception for achievements with no progress
|
||||||
try {
|
try {
|
||||||
user_ach.emplace("progress", std::stof(trig.min_value));
|
uint32 progress_min = std::stoul(trig.min_value);
|
||||||
user_ach.emplace("max_progress", std::stof(trig.max_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(...) {}
|
||||||
} catch(...) {}
|
} catch(...) {}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user