Skip to content

Commit

Permalink
main: commit persistent data after intro cutscene
Browse files Browse the repository at this point in the history
  • Loading branch information
Akaricchi committed Oct 23, 2024
1 parent 021584a commit b9c8dc1
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions src/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -242,6 +242,7 @@ typedef struct MainContext {
ResourceGroup rg;
int replay_idx;
uchar headless : 1;
uchar commit_persistent_data : 1;
} MainContext;

static void main_post_vfsinit(CallChainResult ccr);
Expand Down Expand Up @@ -478,6 +479,7 @@ static void main_post_vfsinit(CallChainResult ccr) {
#endif

if(!progress_is_cutscene_unlocked(CUTSCENE_ID_INTRO) || ctx->cli.force_intro) {
ctx->commit_persistent_data = true;
cutscene_enter(cc_mainmenu, CUTSCENE_ID_INTRO);
eventloop_run();
return;
Expand All @@ -489,6 +491,11 @@ static void main_post_vfsinit(CallChainResult ccr) {

static void main_mainmenu(CallChainResult ccr) {
MainContext *ctx = ccr.ctx;

if(ctx->commit_persistent_data) {
taisei_commit_persistent_data();
}

demoplayer_init();
enter_menu(create_main_menu(), CALLCHAIN(main_cleanup, ctx));
}
Expand Down

0 comments on commit b9c8dc1

Please sign in to comment.