don't even try to load achievements if they're disabled
This commit is contained in:
parent
00e2ca5372
commit
11d89ba289
26
cheevos.c
26
cheevos.c
|
@ -708,6 +708,12 @@ int cheevos_load( const char* json )
|
||||||
NULL
|
NULL
|
||||||
};
|
};
|
||||||
|
|
||||||
|
if ( !config_get_ptr()->cheevos.enable )
|
||||||
|
{
|
||||||
|
/* Just return OK if cheevos are disabled. */
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
/* Count the number of achievements in the JSON file. */
|
/* Count the number of achievements in the JSON file. */
|
||||||
|
|
||||||
unsigned core_count, unofficial_count;
|
unsigned core_count, unofficial_count;
|
||||||
|
@ -745,15 +751,15 @@ int cheevos_load( const char* json )
|
||||||
ud.core_count = 0;
|
ud.core_count = 0;
|
||||||
ud.unofficial_count = 0;
|
ud.unofficial_count = 0;
|
||||||
|
|
||||||
if ( jsonsax_parse( json, &handlers, (void*)&ud ) == JSONSAX_OK )
|
if ( !jsonsax_parse( json, &handlers, (void*)&ud ) == JSONSAX_OK )
|
||||||
{
|
{
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
cheevos_unload();
|
cheevos_unload();
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
/*****************************************************************************
|
/*****************************************************************************
|
||||||
Test all the achievements (call once per frame).
|
Test all the achievements (call once per frame).
|
||||||
*****************************************************************************/
|
*****************************************************************************/
|
||||||
|
@ -1339,6 +1345,12 @@ int cheevos_get_by_game_id( const char** json, unsigned game_id )
|
||||||
{
|
{
|
||||||
char request[ 256 ];
|
char request[ 256 ];
|
||||||
|
|
||||||
|
if ( !config_get_ptr()->cheevos.enable )
|
||||||
|
{
|
||||||
|
/* Just return OK if cheevos are disabled. */
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
if ( !cheevos_login() )
|
if ( !cheevos_login() )
|
||||||
{
|
{
|
||||||
snprintf(
|
snprintf(
|
||||||
|
@ -1410,6 +1422,12 @@ int cheevos_get_by_content( const char** json, const void* data, size_t size )
|
||||||
unsigned game_id;
|
unsigned game_id;
|
||||||
int res;
|
int res;
|
||||||
|
|
||||||
|
if ( !config_get_ptr()->cheevos.enable )
|
||||||
|
{
|
||||||
|
/* Just return OK if cheevos are disabled. */
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
MD5_Init( &ctx );
|
MD5_Init( &ctx );
|
||||||
MD5_Update( &ctx, data, size );
|
MD5_Update( &ctx, data, size );
|
||||||
saved_ctx = ctx;
|
saved_ctx = ctx;
|
||||||
|
|
Loading…
Reference in New Issue