mirror of
https://github.com/wesnoth/wesnoth
synced 2025-05-09 02:03:04 +00:00
Change the handling of LEVEL_CONTINUE_NO_SAVE
...so it's visible at the point where we have to decide whether to do linger mode or not. Then, *don't* linger if the level result is LEVEL_CONTINUE or LEVEL_CONTINUE_NO_SAVE.
This commit is contained in:
parent
edfe7fb3a6
commit
c851831085
@ -1760,7 +1760,7 @@ void game_controller::play_game(RELOAD_GAME_DATA reload)
|
|||||||
const LEVEL_RESULT result = ::play_game(disp(),state_,game_config_,units_data_, log);
|
const LEVEL_RESULT result = ::play_game(disp(),state_,game_config_,units_data_, log);
|
||||||
// don't show The End for multiplayer scenario
|
// don't show The End for multiplayer scenario
|
||||||
// change this if MP campaigns are implemented
|
// change this if MP campaigns are implemented
|
||||||
if(result == VICTORY && (state_.campaign_type.empty() || state_.campaign_type != "multiplayer")) {
|
if((result == VICTORY or result == LEVEL_CONTINUE_NO_SAVE) && (state_.campaign_type.empty() || state_.campaign_type != "multiplayer")) {
|
||||||
the_end(disp());
|
the_end(disp());
|
||||||
about::show_about(disp(),state_.campaign);
|
about::show_about(disp(),state_.campaign);
|
||||||
}
|
}
|
||||||
|
@ -130,7 +130,7 @@ LEVEL_RESULT playsingle_scenario(const game_data& gameinfo, const config& game_c
|
|||||||
).show();
|
).show();
|
||||||
}
|
}
|
||||||
|
|
||||||
if (res != QUIT)
|
if (res != QUIT && res != LEVEL_CONTINUE && res != LEVEL_CONTINUE_NO_SAVE)
|
||||||
playcontroller.linger(log);
|
playcontroller.linger(log);
|
||||||
|
|
||||||
return res;
|
return res;
|
||||||
@ -153,7 +153,7 @@ LEVEL_RESULT playmp_scenario(const game_data& gameinfo, const config& game_confi
|
|||||||
).show();
|
).show();
|
||||||
}
|
}
|
||||||
|
|
||||||
if (res != QUIT)
|
if (res != QUIT && res != LEVEL_CONTINUE && res != LEVEL_CONTINUE_NO_SAVE)
|
||||||
playcontroller.linger(log);
|
playcontroller.linger(log);
|
||||||
|
|
||||||
// tell all clients that the campaign won't continue
|
// tell all clients that the campaign won't continue
|
||||||
@ -291,7 +291,7 @@ LEVEL_RESULT play_game(display& disp, game_state& gamestate, const config& game_
|
|||||||
bool save_game_after_scenario = true;
|
bool save_game_after_scenario = true;
|
||||||
|
|
||||||
const set_random_generator generator_setter(&recorder);
|
const set_random_generator generator_setter(&recorder);
|
||||||
LEVEL_RESULT res;
|
LEVEL_RESULT res = LEVEL_CONTINUE;
|
||||||
|
|
||||||
try {
|
try {
|
||||||
// preserve old label eg. replay
|
// preserve old label eg. replay
|
||||||
@ -377,11 +377,9 @@ LEVEL_RESULT play_game(display& disp, game_state& gamestate, const config& game_
|
|||||||
|
|
||||||
//continue without saving is like a victory, but the
|
//continue without saving is like a victory, but the
|
||||||
//save game dialog isn't displayed
|
//save game dialog isn't displayed
|
||||||
if(res == LEVEL_CONTINUE_NO_SAVE) {
|
if(res == LEVEL_CONTINUE_NO_SAVE)
|
||||||
res = VICTORY;
|
|
||||||
save_game_after_scenario = false;
|
save_game_after_scenario = false;
|
||||||
}
|
if(res != VICTORY && res != LEVEL_CONTINUE_NO_SAVE)
|
||||||
if(res != VICTORY)
|
|
||||||
return res;
|
return res;
|
||||||
} catch(game::load_game_failed& e) {
|
} catch(game::load_game_failed& e) {
|
||||||
gui::show_error_message(disp, _("The game could not be loaded: ") + e.message);
|
gui::show_error_message(disp, _("The game could not be loaded: ") + e.message);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user