Achievements: Disable Hardcore Mode if the game has a RetroAchievements entry, but no achievements or leaderboards

This commit is contained in:
Silent 2023-10-23 21:54:55 +02:00 committed by Connor McLaughlin
parent 7205f10ec2
commit 22590754fd
1 changed files with 12 additions and 2 deletions

View File

@ -932,13 +932,23 @@ void Achievements::ClientLoadGameCallback(int result, const char* error_message,
return;
}
const bool has_achievements = rc_client_has_achievements(client);
const bool has_leaderboards = rc_client_has_leaderboards(client);
// If the game has a RetroAchievements entry but no achievements or leaderboards,
// enforcing hardcore mode is pointless.
if (!has_achievements && !has_leaderboards)
{
DisableHardcoreMode();
}
// We should have matched hardcore mode state.
pxAssertRel(s_hardcore_mode == (rc_client_get_hardcore_enabled(client) != 0), "Hardcore status mismatch");
s_game_id = info->id;
s_game_title = info->title;
s_has_achievements = rc_client_has_achievements(client);
s_has_leaderboards = rc_client_has_leaderboards(client);
s_has_achievements = has_achievements;
s_has_leaderboards = has_leaderboards;
s_has_rich_presence = rc_client_has_rich_presence(client);
s_game_icon = {};