diff --git a/Makefile.common b/Makefile.common index e217f53c09..8f907f4f83 100644 --- a/Makefile.common +++ b/Makefile.common @@ -1472,14 +1472,12 @@ ifeq ($(HAVE_NETWORKING), 1) network/netplay/netplay_buf.o \ network/netplay/netplay_room_parse.o - # Retro Achievements (also depends on threads) + # Retro Achievements ifeq ($(HAVE_CHEEVOS), 1) - ifeq ($(HAVE_THREADS), 1) - DEFINES += -DHAVE_CHEEVOS - OBJ += cheevos/cheevos.o \ - $(LIBRETRO_COMM_DIR)/utils/md5.o - endif + DEFINES += -DHAVE_CHEEVOS + OBJ += cheevos/cheevos.o \ + $(LIBRETRO_COMM_DIR)/utils/md5.o endif ifeq ($(HAVE_KEYMAPPER), 1) diff --git a/cheevos/cheevos.c b/cheevos/cheevos.c index 5db44e6e32..aa6187739b 100644 --- a/cheevos/cheevos.c +++ b/cheevos/cheevos.c @@ -1883,10 +1883,8 @@ static int cheevos_test_condition(cheevos_cond_t *cond) case CHEEVOS_COND_OP_NOT_EQUAL_TO: return sval != tval; default: - break; + return 1; } - - return 0; } static int cheevos_test_cond_set(const cheevos_condset_t *condset, @@ -1925,20 +1923,20 @@ static int cheevos_test_cond_set(const cheevos_condset_t *condset, /* Read all standard conditions, and process as normal: */ for (cond = condset->conds; cond < end; cond++) { - if (cond->type != CHEEVOS_COND_TYPE_STANDARD) + if (cond->type == CHEEVOS_COND_TYPE_PAUSE_IF || cond->type == CHEEVOS_COND_TYPE_RESET_IF) continue; if (cond->type == CHEEVOS_COND_TYPE_ADD_SOURCE) { cheevos_locals.add_buffer += cheevos_get_var_value(&cond->source); - set_valid = 1; + set_valid &= 1; continue; } if (cond->type == CHEEVOS_COND_TYPE_SUB_SOURCE) { cheevos_locals.add_buffer -= cheevos_get_var_value(&cond->source); - set_valid = 1; + set_valid &= 1; continue; } @@ -1954,7 +1952,7 @@ static int cheevos_test_cond_set(const cheevos_condset_t *condset, continue; } - if (cond->req_hits != 0 && cond->curr_hits >= cond->req_hits) + if (cond->req_hits != 0 && (cond->curr_hits + cheevos_locals.add_hits) >= cond->req_hits) continue; cond_valid = cheevos_test_condition(cond); @@ -2417,6 +2415,7 @@ static int cheevos_deactivate__json_number(void *userdata, if (cheevo->id == (unsigned)id) { cheevo->active &= ~ud->mode; + found = 1; break; } } diff --git a/griffin/griffin.c b/griffin/griffin.c index b9491ba463..a15f719fbd 100644 --- a/griffin/griffin.c +++ b/griffin/griffin.c @@ -143,7 +143,7 @@ CONFIG FILE /*============================================================ ACHIEVEMENTS ============================================================ */ -#if defined(HAVE_CHEEVOS) && defined(HAVE_THREADS) +#if defined(HAVE_CHEEVOS) #if !defined(HAVE_NETWORKING) #include "../libretro-common/net/net_http.c" #endif diff --git a/qb/config.libs.sh b/qb/config.libs.sh index bd58bec64b..bd8ed4dc28 100644 --- a/qb/config.libs.sh +++ b/qb/config.libs.sh @@ -497,11 +497,6 @@ if [ "$HAVE_ZLIB" = 'no' ] && [ "HAVE_RPNG" != 'no' ]; then echo "Notice: zlib is not available, RPNG will also be disabled." fi -if [ "$HAVE_THREADS" = 'no' ] && [ "HAVE_CHEEVOS" != 'no' ]; then - HAVE_CHEEVOS=no - echo "Notice: Threads are not available, Cheevos will also be disabled." -fi - if [ "$HAVE_THREADS" = 'no' ] && [ "HAVE_LIBUSB" != 'no' ]; then HAVE_LIBUSB=no echo "Notice: Threads are not available, libusb will also be disabled."