void GameEnd()
{
int hi_pos;
- boolean raise_level = FALSE;
+ int last_level_nr = level_nr;
local_player->LevelSolved_GameEnd = TRUE;
if (setup.increment_levels &&
level_nr < leveldir_current->last_level)
- raise_level = TRUE; /* advance to next level */
+ {
+ level_nr++; /* advance to next level */
+ TapeErase(); /* start with empty tape */
+ }
+
+ hi_pos = NewHiScore(last_level_nr);
- if ((hi_pos = NewHiScore(level_nr)) >= 0)
+ if (hi_pos >= 0)
{
SetGameStatus(GAME_MODE_SCORES);
- DrawHallOfFame(level_nr, hi_pos);
-
- if (raise_level)
- {
- level_nr++;
- TapeErase();
- }
+ DrawHallOfFame(last_level_nr, hi_pos);
}
else
{
SetGameStatus(GAME_MODE_MAIN);
- if (raise_level)
- {
- level_nr++;
- TapeErase();
- }
-
DrawMainMenu();
}
}
drawHallOfFameList(first_entry, highlight_position);
}
}
- else if (button == MB_MENU_LEAVE)
- {
- PlaySound(SND_MENU_ITEM_SELECTING);
-
- FadeSound(SND_BACKGROUND_SCORES);
-
- SetGameStatus(GAME_MODE_MAIN);
-
- DrawMainMenu();
- }
- else if (button == MB_MENU_CHOICE)
+ else if (button == MB_MENU_LEAVE || button == MB_MENU_CHOICE)
{
PlaySound(SND_MENU_ITEM_SELECTING);