Merge pull request #8681 from meleu/patch-5

minor fixes for cheevos-new
This commit is contained in:
Twinaphex 2019-05-03 19:33:47 +02:00 committed by GitHub
commit 27712d648a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 15 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 */

View File

@ -3281,6 +3281,7 @@ static int action_ok_cheevos_toggle_hardcore_mode(const char *path,
{
#ifdef HAVE_CHEEVOS
cheevos_hardcore_paused = !cheevos_hardcore_paused;
rcheevos_hardcore_paused = !rcheevos_hardcore_paused;
#endif
generic_action_ok_command(CMD_EVENT_CHEEVOS_HARDCORE_MODE_TOGGLE);
return generic_action_ok_command(CMD_EVENT_RESUME);