ignore buggy leaderboards

This commit is contained in:
meleu 2019-05-03 02:19:13 -03:00 committed by meleu
parent 7b47787887
commit eb81597871
2 changed files with 14 additions and 3 deletions

View File

@ -283,6 +283,8 @@ static const char* rcheevos_rc_error(int ret)
static int rcheevos_parse(const char* json)
{
char buffer[256];
settings_t *settings = config_get_ptr();
int res = 0;
int i = 0;
unsigned j = 0;
@ -380,11 +382,18 @@ static int rcheevos_parse(const char* json)
lboard->info = rcheevos_locals.patchdata.lboards + j;
res = rc_lboard_size(lboard->info->mem);
CHEEVOS_LOG(RCHEEVOS_TAG "rc_lboard_size() = %d\n", res);
if (res < 0)
{
CHEEVOS_ERR(RCHEEVOS_TAG "Error in leaderboard mem %s: %s",
lboard->info->mem, rcheevos_rc_error(res));
goto error;
snprintf(buffer, sizeof(buffer), "Error in leaderboard %d \"%s\"", lboard->info->id, lboard->info->title);
if (settings->bools.cheevos_verbose_enable)
runloop_msg_queue_push(buffer, 0, 3 * 60, false, NULL, MESSAGE_QUEUE_ICON_DEFAULT, MESSAGE_QUEUE_CATEGORY_INFO);
CHEEVOS_ERR(RCHEEVOS_TAG "%s: '%s' mem: %s\n", buffer, rcheevos_rc_error(res), lboard->info->mem);
lboard->lboard = NULL;
continue;
}
lboard->lboard = (rc_lboard_t*)calloc(1, res);

View File

@ -166,6 +166,8 @@ int rc_evaluate_lboard(rc_lboard_t* self, unsigned* value, rc_peek_t peek, void*
int start_ok, cancel_ok, submit_ok;
int action = -1;
if (!self) return RC_LBOARD_INACTIVE;
rc_update_memref_values(self->memrefs, peek, peek_ud);
/* ASSERT: these are always tested once every frame, to ensure delta variables work properly */