From 6903602665e97d41e57261a6e8782d3ed51c3453 Mon Sep 17 00:00:00 2001 From: Andre Leiradella Date: Sun, 26 Nov 2017 22:03:59 +0000 Subject: [PATCH 1/2] Set cheevos_loaded to false if the cheevos and leaderboard lists are empty --- cheevos/cheevos.c | 41 +++++------------------------------------ 1 file changed, 5 insertions(+), 36 deletions(-) diff --git a/cheevos/cheevos.c b/cheevos/cheevos.c index d04aafaf16..d1f392885d 100644 --- a/cheevos/cheevos.c +++ b/cheevos/cheevos.c @@ -213,42 +213,6 @@ typedef struct cheevos_expr_t value; } cheevos_leaderboard_t; -/* -typedef struct -{ - bool is_lookup; - char* prestring; - cheevos_expr_t expression; -} cheevos_rps_element_t; - -typedef struct -{ - char* name; - unsigned type; -} cheevos_rps_format_t; - -typedef struct -{ - unsigned compare; - char* result; -} cheevos_rps_lookup_value; - -typedef struct -{ - char* name; - cheevos_rps_lookup_value* values; -} cheevos_rps_lookup_t; - -typedef struct -{ - cheevos_rps_element_t* elements; - cheevos_rps_format_t* formats; - unsigned format_count; - cheevos_rps_lookup_t* lookups; - unsigned lookup_count; -} cheevos_rps_t; -*/ - typedef struct { int console_id; @@ -2847,6 +2811,11 @@ static int cheevos_iterate(coro_t* coro) runloop_msg_queue_push(msg, 0, 6 * 60, false); } + if ( cheevos_locals.core.count == 0 + && cheevos_locals.unofficial.count == 0 + && cheevos_locals.lboard_count == 0) + cheevos_unload(); + CORO_STOP(); /************************************************************************** From 130a0018469b5452d4f79d55e7ecfa6c4e258599 Mon Sep 17 00:00:00 2001 From: leiradel Date: Thu, 7 Dec 2017 19:49:39 +0000 Subject: [PATCH 2/2] Fixed wrong leaderboard count --- cheevos/cheevos.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/cheevos/cheevos.c b/cheevos/cheevos.c index 662c8b6dea..e70e425667 100644 --- a/cheevos/cheevos.c +++ b/cheevos/cheevos.c @@ -802,6 +802,7 @@ static int cheevos_count_cheevos(const char *json, int res; cheevos_countud_t ud; ud.in_cheevos = 0; + ud.in_lboards = 0; ud.core_count = 0; ud.unofficial_count = 0; ud.lboard_count = 0; @@ -2829,6 +2830,7 @@ static int cheevos_iterate(coro_t* coro) && cheevos_locals.lboard_count == 0) cheevos_unload(); + CORO_GOSUB(GET_BADGES); CORO_STOP(); /**************************************************************************