fix need-to-activate achievement logic for non-hardcore

This commit is contained in:
Jamiras 2021-11-08 08:34:51 -07:00
parent a93a2e3366
commit af23c5c900

View File

@ -239,13 +239,12 @@ static void rcheevos_activate_achievements(void)
int result; int result;
rcheevos_racheevo_t* achievement = rcheevos_locals.game.achievements; rcheevos_racheevo_t* achievement = rcheevos_locals.game.achievements;
settings_t* settings = config_get_ptr(); settings_t* settings = config_get_ptr();
const uint8_t active_flag = rcheevos_locals.hardcore_active ? RCHEEVOS_ACTIVE_HARDCORE : RCHEEVOS_ACTIVE_SOFTCORE;
for (i = 0; i < rcheevos_locals.game.achievement_count; for (i = 0; i < rcheevos_locals.game.achievement_count;
i++, achievement++) i++, achievement++)
{ {
if ((achievement->active & (RCHEEVOS_ACTIVE_HARDCORE | RCHEEVOS_ACTIVE_SOFTCORE)) != 0) if ((achievement->active & active_flag) != 0)
{
if (!rcheevos_locals.hardcore_active || (achievement->active & RCHEEVOS_ACTIVE_HARDCORE) != 0)
{ {
result = rc_runtime_activate_achievement(&rcheevos_locals.runtime, achievement->id, achievement->memaddr, NULL, 0); result = rc_runtime_activate_achievement(&rcheevos_locals.runtime, achievement->id, achievement->memaddr, NULL, 0);
if (result != RC_OK) if (result != RC_OK)
@ -268,7 +267,6 @@ static void rcheevos_activate_achievements(void)
} }
} }
} }
}
} }
static rcheevos_racheevo_t* rcheevos_find_cheevo(unsigned id) static rcheevos_racheevo_t* rcheevos_find_cheevo(unsigned id)