Minor fixes

This commit is contained in:
Alayan 2018-10-06 01:26:44 +02:00 committed by auriamg
parent 9e6bc5d5ba
commit ff5bb8792e
2 changed files with 5 additions and 7 deletions

View File

@ -105,20 +105,20 @@ void Achievement::setGoalValue(std::string &goal_string, int value)
if(m_achieved) // This should not happen, but it costs little to double-check if(m_achieved) // This should not happen, but it costs little to double-check
return; return;
bool AO = true; bool and_or = true;
bool SAAO = true; bool sum_andatonce = true;
if (goal_string.compare(0 /*start of sub-string*/,5/*length*/,"LOGC-") == 0) if (goal_string.compare(0 /*start of sub-string*/,5/*length*/,"LOGC-") == 0)
{ {
AO = false; and_or = false;
goal_string = goal_string.substr(5,999); goal_string = goal_string.substr(5,999);
} }
else if (goal_string.compare(0 /*start of sub-string*/,5/*length*/,"LOGM-") == 0) else if (goal_string.compare(0 /*start of sub-string*/,5/*length*/,"LOGM-") == 0)
{ {
SAAO = false; sum_andatonce = false;
goal_string = goal_string.substr(5,999); goal_string = goal_string.substr(5,999);
} }
bool found = recursiveSetGoalValue(m_progress_goal_tree, goal_string, value, AO, SAAO); bool found = recursiveSetGoalValue(m_progress_goal_tree, goal_string, value, and_or, sum_andatonce);
// If a value has been updated, check for completion // If a value has been updated, check for completion
if (found && recursiveCompletionCheck(m_progress_goal_tree, m_achievement_info->m_goal_tree)) if (found && recursiveCompletionCheck(m_progress_goal_tree, m_achievement_info->m_goal_tree))

View File

@ -450,8 +450,6 @@ void AchievementsStatus::increaseDataVar(unsigned int achieve_data_id, int incre
if (achieve_data_id<ACHIEVE_DATA_NUM) if (achieve_data_id<ACHIEVE_DATA_NUM)
{ {
m_variables[achieve_data_id].counter += increase; m_variables[achieve_data_id].counter += increase;
if (m_variables[achieve_data_id].counter > 10000000)
m_variables[achieve_data_id].counter = 10000000;
updateAchievementsProgress(UP_ACHIEVEMENT_DATA, achieve_data_id); updateAchievementsProgress(UP_ACHIEVEMENT_DATA, achieve_data_id);
} }