Fixed difficulty selection popping up multiple times when loading a game (fixes #5392)

The first issue was difficulty_dialog::show being called twice. The second issue was that show_difficulty_dialog
was called from both load_game_ingame and load_game. The latter is called after the former (this should probably
be refactored), so if you selected Change Difficulty when loading from within a game, the dialog prompt would be
shown when both functions were called. Fixed this by toggling off the show_difficulty flag once a difficulty had
been selected.
This commit is contained in:
Charles Dang 2021-01-16 23:24:12 +11:00
parent f69aa281c1
commit bf153a1f76
2 changed files with 2 additions and 1 deletions

View file

@ -22,6 +22,7 @@
* New `[set_variable]` options: reverse=yes, min=list, max=list
### Miscellaneous and Bug Fixes
* Fixed `[terrain_defaults]` and `[resistance_defaults]` (issue #5308).
* Fixed being prompted multiple times to select campaign difficulty when loading a game (issue #5392)
## Version 1.15.8
### Add-ons client

View file

@ -101,7 +101,6 @@ bool loadgame::show_difficulty_dialog()
}
gui2::dialogs::campaign_difficulty difficulty_dlg(campaign);
difficulty_dlg.show();
// Return if canceled, since otherwise load_data_.difficulty will be set to 'CANCEL'
if(!difficulty_dlg.show()) {
@ -109,6 +108,7 @@ bool loadgame::show_difficulty_dialog()
}
load_data_.difficulty = difficulty_dlg.selected_difficulty();
load_data_.select_difficulty = false;
// Exit loop
break;