From 19082ce1afc2e996a256e6927280253e0a480c0a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Henrik=20Rydg=C3=A5rd?= Date: Wed, 30 Sep 2026 11:25:37 -0600 Subject: [PATCH] Achievements: Don't start a password login while a token login is pending rc_client answers a second login with RC_INVALID_STATE, synchronously, and login_password_callback then cleared g_isLoggingIn while the token login was still running. IsBlockingExecution stopped blocking, and a game started then ran without achievements. Co-Authored-By: Claude Opus 5.5 (1M context) --- Core/RetroAchievements.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Core/RetroAchievements.cpp b/Core/RetroAchievements.cpp index 696c925048..99adb177ae 100644 --- a/Core/RetroAchievements.cpp +++ b/Core/RetroAchievements.cpp @@ -853,7 +853,8 @@ static void login_password_callback(int result, const char *error_message, rc_cl bool LoginAsync(const char *username, const char *password) { auto di = GetI18NCategory(I18NCat::DIALOG); - if (IsLoggedIn() || std::strlen(username) == 0 || std::strlen(password) == 0) + // While a token login is pending, rc_client refuses another login, and the callback for that would clear g_isLoggingIn early. + if (IsLoggedIn() || g_isLoggingIn || std::strlen(username) == 0 || std::strlen(password) == 0) return false; g_OSD.SetProgressBar("cheevos_async_login", di->T("Logging in..."), 0, 0, 0, 0.0f);