Fixes overwriting for automatic savegames.

This commit is contained in:
Jörg Hinrichs 2009-04-29 19:56:19 +00:00
parent 970416c6f2
commit 61e25db590
2 changed files with 9 additions and 3 deletions

View file

@ -481,7 +481,7 @@ savegame::savegame(game_state& gamestate, const bool compress_saves, const std::
bool savegame::save_game_interactive(CVideo& video, const std::string& message,
gui::DIALOG_TYPE dialog_type, const bool has_exit_button,
const bool ask_for_filename)
bool ask_for_filename)
{
show_confirmation_ = ask_for_filename;
create_filename();
@ -496,8 +496,14 @@ bool savegame::save_game_interactive(CVideo& video, const std::string& message,
exit = true;
}
if (res == gui2::twindow::OK)
if (res == gui2::twindow::OK){
exit = check_overwrite(video);
if (!exit){
ask_for_filename = true;
show_confirmation_ = true;
}
}
}
catch (illegal_filename_exception){
exit = false;

View file

@ -150,7 +150,7 @@ public:
saves. The return value denotes, if the save was successful or not. */
bool save_game_interactive(CVideo& gui, const std::string& message,
gui::DIALOG_TYPE dialog_type, const bool has_exit_button = false,
const bool ask_for_filename = true);
bool ask_for_filename = true);
const std::string filename() const { return filename_; }