added storing next level to play from hall of fame
authorHolger Schemel <info@artsoft.org>
Wed, 11 May 2022 11:54:19 +0000 (13:54 +0200)
committerHolger Schemel <info@artsoft.org>
Wed, 11 May 2022 11:54:19 +0000 (13:54 +0200)
src/files.c
src/game.c
src/main.h
src/screens.c

index f0ed1e41cc2ee1b13c6bf5375a1d0f1d7d84ee6e..4a980dffc748708fd4485a8f9b72d4e89252ab4e 100644 (file)
@@ -8693,6 +8693,7 @@ static void setScoreInfoToDefaultsExt(struct ScoreInfo *scores)
   // The following values are intentionally not reset here:
   // - last_level_nr
   // - last_entry_nr
+  // - next_level_nr
   // - continue_playing
   // - continue_on_return
 }
index aff7972a58dc70b9f1e6ed620c77e2b6cacd2c48..259d19b6c54f858bee6ca6701bd6ce5b64ec94fd 100644 (file)
@@ -5051,6 +5051,7 @@ void GameEnd(void)
     if (setup.auto_play_next_level)
     {
       scores.continue_playing = TRUE;
+      scores.next_level_nr = level_nr;
 
       LoadLevel(level_nr);
 
index 4d566eae281fdce27664a3e70bfbcf6cd1860e07..f1b3f1ac08f62ccfa300ddb11d895e3719c11831 100644 (file)
@@ -3123,6 +3123,7 @@ struct ScoreInfo
   int last_added_local;
   int last_level_nr;
   int last_entry_nr;
+  int next_level_nr;
 
   boolean updated;
   boolean uploaded;
index 1bc0dcd66283c6d5e76b817d3a29800ad2141da1..2b575392c2ef6d921c50f91393047e282bd63a6d 100644 (file)
@@ -4341,6 +4341,9 @@ static int getAlignYOffsetFromTreeInfo(TreeInfo *ti)
 
 static void StartPlayingFromHallOfFame(void)
 {
+  level_nr = scores.next_level_nr;
+  LoadLevel(level_nr);
+
   StartGameActions(network.enabled, setup.autorecord, level.random_seed);
 }