fix #8725 again including:

- allow savestates on hardcore
- fix weird conditions happening due to having two implementations
- fix popup saying state was loaded when starting a game with achievements hardcore after a game with no achievements
- fix rewind not working when loading games with no achievements after loading games with achievements hardcore
This commit is contained in:
radius 2019-05-20 20:24:39 -05:00 committed by twinaphex
parent f17655f073
commit eef4ada025
4 changed files with 11 additions and 4 deletions

View File

@ -952,6 +952,7 @@ bool rcheevos_unload(void)
rcheevos_locals.lboards = NULL;
rcheevos_loaded = false;
rcheevos_hardcore_active = false;
rcheevos_hardcore_paused = false;
rcheevos_state_loaded_flag = false;
}

View File

@ -2263,6 +2263,7 @@ bool cheevos_unload(void)
cheevos_locals.unofficial.count = 0;
cheevos_loaded = false;
cheevos_hardcore_active = false;
cheevos_hardcore_paused = false;
cheevos_state_loaded_flag = false;
@ -2282,6 +2283,9 @@ bool cheevos_toggle_hardcore_mode(void)
const char *msg = msg_hash_to_str(
MSG_CHEEVOS_HARDCORE_MODE_ENABLE);
/* reset the state loaded flag in case it was set */
cheevos_state_loaded_flag = false;
/* send reset core cmd to avoid any user
* savestate previusly loaded. */
command_event(CMD_EVENT_RESET, NULL);

View File

@ -1730,7 +1730,10 @@ static bool command_event_main_state(unsigned cmd)
{
#ifdef HAVE_CHEEVOS
/* RCHEEVOS TODO: remove duplication below */
rcheevos_state_loaded_flag = cheevos_state_loaded_flag = true;
if (cheevos_hardcore_active)
cheevos_state_loaded_flag = true;
if (rcheevos_hardcore_active)
rcheevos_state_loaded_flag = true;
#endif
ret = true;
#ifdef HAVE_NETWORKING

View File

@ -4167,12 +4167,11 @@ static enum runloop_state runloop_check_state(
/* RCHEEVOS TODO: remove the 'rcheevos_*' below */
rcheevos_hardcore_active = settings->bools.cheevos_enable
&& settings->bools.cheevos_hardcore_mode_enable
&& rcheevos_loaded && rcheevos_hardcore_paused;
&& rcheevos_loaded && !rcheevos_hardcore_paused;
cheevos_hardcore_active = settings->bools.cheevos_enable
&& settings->bools.cheevos_hardcore_mode_enable
&& cheevos_loaded && cheevos_hardcore_paused;
&& cheevos_loaded && !cheevos_hardcore_paused;
if (!settings->bools.cheevos_old_enable)
{
if (rcheevos_hardcore_active && rcheevos_state_loaded_flag)