Fix achievements being awarded upon game reset.

This commit is contained in:
Andre Leiradella 2016-11-04 19:56:31 +00:00
parent e92aa45815
commit 14cebec15d
3 changed files with 26 additions and 3 deletions

View File

@ -2499,6 +2499,25 @@ found:
return false;
}
void cheevos_reset_game(void)
{
cheevo_t *cheevo = cheevos_locals.core.cheevos;
const cheevo_t *end = cheevo + cheevos_locals.core.count;
for (; cheevo < end; cheevo++)
{
cheevo->last = 1;
}
cheevo = cheevos_locals.unofficial.cheevos;
end = cheevo + cheevos_locals.unofficial.count;
for (; cheevo < end; cheevo++)
{
cheevo->last = 1;
}
}
void cheevos_populate_menu(void *data)
{
#ifdef HAVE_MENU

View File

@ -41,6 +41,8 @@ typedef struct
bool cheevos_load(const void *data);
void cheevos_reset_game(void);
void cheevos_populate_menu(void *data);
bool cheevos_get_description(cheevos_ctx_desc_t *desc);

View File

@ -44,6 +44,7 @@
#include "verbosity.h"
#include "gfx/video_driver.h"
#include "audio/audio_driver.h"
#include "cheevos.h"
static struct retro_core_t core;
static unsigned core_poll_type;
@ -355,6 +356,7 @@ bool core_get_system_av_info(struct retro_system_av_info *av_info)
bool core_reset(void)
{
core.retro_reset();
cheevos_reset_game();
return true;
}