mirror of
https://github.com/Detanup01/gbe_fork.git
synced 2024-12-25 09:54:15 +08:00
don't allow achievement trigger to propagate its error to next lines, this allows ahievements to be initialzied properly
This commit is contained in:
parent
f7c7d79e0a
commit
06189e303f
@ -730,13 +730,15 @@ Steam_User_Stats::Steam_User_Stats(Settings *settings, class Networking *network
|
||||
std::string name = static_cast<std::string const&>(it["name"]);
|
||||
sorted_achievement_names.push_back(name);
|
||||
|
||||
achievement_trigger trig;
|
||||
achievement_trigger trig{};
|
||||
try {
|
||||
trig.name = name;
|
||||
trig.value_operation = static_cast<std::string const&>(it["progress"]["value"]["operation"]);
|
||||
std::string stat_name = common_helpers::ascii_to_lowercase(static_cast<std::string const&>(it["progress"]["value"]["operand1"]));
|
||||
trig.min_value = static_cast<std::string const&>(it["progress"]["min_val"]);
|
||||
trig.max_value = static_cast<std::string const&>(it["progress"]["max_val"]);
|
||||
achievement_stat_trigger[stat_name].push_back(trig);
|
||||
} catch(...) {}
|
||||
|
||||
if (user_achievements.find(name) == user_achievements.end()) {
|
||||
user_achievements[name]["earned"] = false;
|
||||
|
Loading…
x
Reference in New Issue
Block a user