Skip to content

Commit

Permalink
Removed redundant calls to game_launcher::clear_loaded_game
Browse files Browse the repository at this point in the history
Calling game_launcher::load_game already cleared the loaded data if present unconditionally.
  • Loading branch information
Vultraz committed Jan 5, 2021
1 parent d9680a9 commit 5242fa3
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 6 deletions.
2 changes: 0 additions & 2 deletions src/gui/dialogs/title_screen.cpp
Expand Up @@ -340,8 +340,6 @@ void title_screen::pre_show(window& win)
register_button(win, "load", hotkey::HOTKEY_LOAD_GAME, [this, &win]() {
if(game_.load_game()) {
win.set_retval(LAUNCH_GAME);
} else {
game_.clear_loaded_game();
}
});

Expand Down
5 changes: 1 addition & 4 deletions src/wesnoth.cpp
Expand Up @@ -884,10 +884,7 @@ static int do_gameloop(const std::vector<std::string>& args)

// If loading a game, skip the titlescreen entirely
if(game->is_loading()) {
if(!game->load_game()) {
game->clear_loaded_game();
}

game->load_game();
game->launch_game(should_reload);
continue;
}
Expand Down

0 comments on commit 5242fa3

Please sign in to comment.