Simplify some code in load_content - only do cheevos calls

when content has been successfully loaded
This commit is contained in:
twinaphex 2016-01-27 08:48:19 +01:00
parent d658c1e09b
commit 9ad2e6fa1f

View File

@ -538,20 +538,24 @@ static bool load_content(
if (special) if (special)
ret = core.retro_load_game_special(special->id, info, content->size); ret = core.retro_load_game_special(special->id, info, content->size);
else else
{
ret = core.retro_load_game(*content->elems[0].data ? info : NULL); ret = core.retro_load_game(*content->elems[0].data ? info : NULL);
if (!ret)
{
RARCH_ERR("%s.\n", msg_hash_to_str(MSG_FAILED_TO_LOAD_CONTENT));
return false;
}
#ifdef HAVE_CHEEVOS #ifdef HAVE_CHEEVOS
if (!special)
{
/* Load the achievements into memory if the game has content. */ /* Load the achievements into memory if the game has content. */
cheevos_set_cheats(); cheevos_set_cheats();
cheevos_load(*content->elems[0].data ? info : NULL); cheevos_load(*content->elems[0].data ? info : NULL);
#endif
} }
#endif
if (!ret) return true;
RARCH_ERR("%s.\n", msg_hash_to_str(MSG_FAILED_TO_LOAD_CONTENT));
return ret;
} }
static bool init_content_file_subsystem( static bool init_content_file_subsystem(