mirror of
https://github.com/hrydgard/ppsspp.git
synced 2024-11-23 13:30:02 +00:00
Merge pull request #17772 from hrydgard/fix-achievements-from-frontend
Fix issue where achievements wouldn't always activate when starting from frontends
This commit is contained in:
commit
add3a6b01d
@ -647,12 +647,14 @@ struct FileContext {
|
||||
|
||||
static BlockDevice *g_blockDevice;
|
||||
|
||||
bool IsReadyToStart() {
|
||||
return !g_isLoggingIn;
|
||||
}
|
||||
|
||||
void SetGame(const Path &path, FileLoader *fileLoader) {
|
||||
// If we are currently logging in, give it a couple of seconds. This is not ideal, but works.
|
||||
if (g_isLoggingIn) {
|
||||
for (int i = 0; i < 3000 / 50; i++) {
|
||||
sleep_ms(50);
|
||||
}
|
||||
// IsReadyToStart should have been checked, so we shouldn't be here.
|
||||
ERROR_LOG(ACHIEVEMENTS, "Still logging in during SetGame - shouldn't happen");
|
||||
}
|
||||
|
||||
if (!g_rcClient || !IsLoggedIn()) {
|
||||
|
@ -106,6 +106,7 @@ bool HasAchievementsOrLeaderboards();
|
||||
bool LoginAsync(const char *username, const char *password);
|
||||
void Logout();
|
||||
|
||||
bool IsReadyToStart();
|
||||
void SetGame(const Path &path, FileLoader *fileLoader);
|
||||
void ChangeUMD(const Path &path); // for in-game UMD change
|
||||
void UnloadGame(); // Call when leaving a game.
|
||||
|
@ -418,6 +418,10 @@ bool PSP_InitStart(const CoreParameter &coreParam, std::string *error_string) {
|
||||
return false;
|
||||
}
|
||||
|
||||
if (!Achievements::IsReadyToStart()) {
|
||||
return false;
|
||||
}
|
||||
|
||||
#if defined(_WIN32) && PPSSPP_ARCH(AMD64)
|
||||
NOTICE_LOG(BOOT, "PPSSPP %s Windows 64 bit", PPSSPP_GIT_VERSION);
|
||||
#elif defined(_WIN32) && !PPSSPP_ARCH(AMD64)
|
||||
|
Loading…
Reference in New Issue
Block a user