fixed bug with leaving scores screen on Android platform (again)
[rocksndiamonds.git] / src / screens.c
index 326fa677c0973404caa4abd28f6dfb97b7746e92..98cb6ba9b8a72aa5ed469572a37d2de442c3ea15 100644 (file)
@@ -4353,6 +4353,9 @@ static void DrawChooseTree(TreeInfo **ti_ptr)
   boolean restart_music = (game_status != game_status_last_screen &&
                           game_status_last_screen != GAME_MODE_SCOREINFO);
 
+  scores.continue_on_return = (game_status == GAME_MODE_SCORES &&
+                              game_status_last_screen == GAME_MODE_PLAYING);
+
   if (CheckFadeAll())
     fade_mask = REDRAW_ALL;
 
@@ -4810,8 +4813,8 @@ static void HandleChooseTree(int mx, int my, int dx, int dy, int button,
   }
 
 #if defined(PLATFORM_ANDROID)
-  // touching the screen anywhere continues playing the next level
-  if ((mx || my) && scores.continue_playing)
+  // directly continue when touching the screen after playing
+  if ((mx || my) && scores.continue_on_return)
   {
     mx = my = 0;
     button = MB_MENU_CHOICE;
@@ -5311,7 +5314,7 @@ static void DrawHallOfFame_setScoreEntries(void)
   if (score_entry_current == NULL)
     score_entry_current = getFirstValidTreeInfoEntry(score_entries);
 
-  if (score_entries != NULL && scores.last_added >= 0)
+  if (score_entries != NULL && scores.continue_playing)
     setString(&score_entries->node_group->name, BACKLINK_TEXT_NEXT);
 
   // ("score_entries" and "score_entry_current" may be NULL here)
@@ -5320,7 +5323,6 @@ static void DrawHallOfFame_setScoreEntries(void)
 void DrawHallOfFame(int nr)
 {
   scores.last_level_nr = nr;
-  scores.continue_on_return = (game_status_last_screen == GAME_MODE_PLAYING);
 
   // (this is needed when called from GameEnd() after winning a game)
   KeyboardAutoRepeatOn();