Skip to content

Commit

Permalink
fix issue story mode at end game
Browse files Browse the repository at this point in the history
  • Loading branch information
vayan committed Dec 16, 2023
1 parent ce81204 commit f7729f6
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/menu.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -517,6 +517,12 @@ bool Menu::handle_play_menu(Game *game)
game->set_game_mode(GameMode::Story);
save_data data = game->get_save()->get_data();
selected_level = data.latest_story_level.integer();

if (selected_level >= number_of_levels)
{
selected_level = number_of_levels - 1;
}

game->get_player()->set_money(data.story_money);
game->get_player()->set_life(data.story_life);
return false;
Expand Down

0 comments on commit f7729f6

Please sign in to comment.