Skip to content

Commit d65c8a3

Browse files
authored
Achievements: Keep track of the earliest unlocked win condition (#3504)
For sets that have more than one win condition, e.g. RE2.
1 parent 9b99d99 commit d65c8a3

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

dep/rcheevos/src/rc_client.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -954,9 +954,9 @@ static void rc_client_subset_get_user_game_summary(const rc_client_subset_info_t
954954
}
955955
else if (achievement->public_.type == RC_CLIENT_ACHIEVEMENT_TYPE_WIN)
956956
{
957-
first_win_condition_unlock = (first_win_condition_unlock == 0) ?
958-
achievement->public_.unlock_time :
959-
first_win_condition_unlock;
957+
if (first_win_condition_unlock == 0 ||
958+
(achievement->public_.unlock_time > 0 && achievement->public_.unlock_time < first_win_condition_unlock))
959+
first_win_condition_unlock = achievement->public_.unlock_time;
960960
}
961961
}
962962

@@ -979,7 +979,7 @@ static void rc_client_subset_get_user_game_summary(const rc_client_subset_info_t
979979
* is unlocked, or all progression achievements are unlocked and no there are no win condition achievements. */
980980
summary->beaten_time = 0;
981981
if (num_progression_achievements > 0 && unlocked_progression_achievements == num_progression_achievements &&
982-
(num_win_condition_achievements == 0 || first_win_condition_unlock > 0)) {
982+
(num_win_condition_achievements == 0 || first_win_condition_unlock > 0)) {
983983
summary->beaten_time = (num_win_condition_achievements == 0) ? last_progression_unlock : first_win_condition_unlock;
984984
}
985985

0 commit comments

Comments
 (0)