Fix possible crash.
parent
dc95076faa
commit
c48526d49a
|
@ -239,6 +239,7 @@ bool GetAchievement( const char *pchName, bool *pbAchieved )
|
||||||
|
|
||||||
try {
|
try {
|
||||||
auto it = defined_achievements_find(pchName);
|
auto it = defined_achievements_find(pchName);
|
||||||
|
if (it == defined_achievements.end()) return false;
|
||||||
std::string pch_name = it->value("name", std::string());
|
std::string pch_name = it->value("name", std::string());
|
||||||
|
|
||||||
auto ach = user_achievements.find(pch_name);
|
auto ach = user_achievements.find(pch_name);
|
||||||
|
@ -261,6 +262,7 @@ bool SetAchievement( const char *pchName )
|
||||||
|
|
||||||
try {
|
try {
|
||||||
auto it = defined_achievements_find(pchName);
|
auto it = defined_achievements_find(pchName);
|
||||||
|
if (it == defined_achievements.end()) return false;
|
||||||
std::string pch_name = it->value("name", std::string());
|
std::string pch_name = it->value("name", std::string());
|
||||||
|
|
||||||
if (it != defined_achievements.end()) {
|
if (it != defined_achievements.end()) {
|
||||||
|
@ -288,6 +290,7 @@ bool ClearAchievement( const char *pchName )
|
||||||
|
|
||||||
try {
|
try {
|
||||||
auto it = defined_achievements_find(pchName);
|
auto it = defined_achievements_find(pchName);
|
||||||
|
if (it == defined_achievements.end()) return false;
|
||||||
std::string pch_name = it->value("name", std::string());
|
std::string pch_name = it->value("name", std::string());
|
||||||
|
|
||||||
if (it != defined_achievements.end()) {
|
if (it != defined_achievements.end()) {
|
||||||
|
@ -313,6 +316,7 @@ bool GetAchievementAndUnlockTime( const char *pchName, bool *pbAchieved, uint32
|
||||||
|
|
||||||
try {
|
try {
|
||||||
auto it = defined_achievements_find(pchName);
|
auto it = defined_achievements_find(pchName);
|
||||||
|
if (it == defined_achievements.end()) return false;
|
||||||
std::string pch_name = it->value("name", std::string());
|
std::string pch_name = it->value("name", std::string());
|
||||||
|
|
||||||
auto ach = user_achievements.find(pch_name);
|
auto ach = user_achievements.find(pch_name);
|
||||||
|
@ -417,6 +421,8 @@ bool IndicateAchievementProgress( const char *pchName, uint32 nCurProgress, uint
|
||||||
|
|
||||||
try {
|
try {
|
||||||
auto it = defined_achievements_find(pchName);
|
auto it = defined_achievements_find(pchName);
|
||||||
|
if (it == defined_achievements.end()) return false;
|
||||||
|
|
||||||
std::string pch_name = it->value("name", std::string());
|
std::string pch_name = it->value("name", std::string());
|
||||||
|
|
||||||
auto ach = user_achievements.find(pch_name);
|
auto ach = user_achievements.find(pch_name);
|
||||||
|
|
Loading…
Reference in New Issue