From b6aa95cf16089f06b60c5fd1147e1c7883a1cfc0 Mon Sep 17 00:00:00 2001 From: gugueU Date: Fri, 30 Dec 2022 14:38:21 +0100 Subject: [PATCH] Update selected save slot when start with cli --entryslot --- command.c | 5 ++++- command.h | 2 +- runloop.c | 2 +- 3 files changed, 6 insertions(+), 3 deletions(-) diff --git a/command.c b/command.c index 86730aa2c9..76f5599925 100644 --- a/command.c +++ b/command.c @@ -1206,7 +1206,7 @@ void command_event_init_cheats( } #endif -bool command_event_load_entry_state(void) +bool command_event_load_entry_state(settings_t *settings) { char entry_state_path[PATH_MAX_LENGTH]; int entry_path_stats; @@ -1248,6 +1248,9 @@ bool command_event_load_entry_state(void) entry_state_path, ret ? "succeeded" : "failed" ); + if (ret) + configuration_set_int(settings, settings->ints.state_slot, runloop_st->entry_state_slot); + return ret; } diff --git a/command.h b/command.h index be82194656..1be36000b6 100644 --- a/command.h +++ b/command.h @@ -391,7 +391,7 @@ void command_event_set_volume( void command_event_init_controllers(rarch_system_info_t *info, settings_t *settings, unsigned num_active_users); -bool command_event_load_entry_state(void); +bool command_event_load_entry_state(settings_t *settings); void command_event_load_auto_state(void); diff --git a/runloop.c b/runloop.c index 45a6f168a1..e921ef8290 100644 --- a/runloop.c +++ b/runloop.c @@ -5359,7 +5359,7 @@ static bool event_init_content( if (!cheevos_enable || !cheevos_hardcore_mode_enable) #endif { - if (runloop_st->entry_state_slot && !command_event_load_entry_state()) + if (runloop_st->entry_state_slot && !command_event_load_entry_state(settings)) runloop_st->entry_state_slot = 0; if (!runloop_st->entry_state_slot && settings->bools.savestate_auto_load) command_event_load_auto_state();