When loading some invalid WML,
don't abort the game but go back to the main menu instead.
This commit is contained in:
parent
198656da96
commit
5ca206a1c2
1 changed files with 18 additions and 3 deletions
21
src/game.cpp
21
src/game.cpp
|
@ -467,7 +467,12 @@ bool game_controller::play_test()
|
|||
state_.campaign_type = "test";
|
||||
state_.scenario = "test";
|
||||
|
||||
refresh_game_cfg();
|
||||
try {
|
||||
refresh_game_cfg();
|
||||
} catch(config::error&) {
|
||||
reset_game_cfg();
|
||||
return false;
|
||||
}
|
||||
|
||||
try {
|
||||
upload_log nolog(false);
|
||||
|
@ -719,7 +724,12 @@ bool game_controller::load_game()
|
|||
defines_map_[*i] = preproc_define();
|
||||
}
|
||||
|
||||
refresh_game_cfg();
|
||||
try {
|
||||
refresh_game_cfg();
|
||||
} catch(config::error&) {
|
||||
reset_game_cfg();
|
||||
return false;
|
||||
}
|
||||
|
||||
state_ = game_state(units_data_,cfg);
|
||||
|
||||
|
@ -1797,7 +1807,12 @@ void game_controller::play_game(RELOAD_GAME_DATA reload)
|
|||
defines_map_["MEDIUM"] = preproc_define();
|
||||
}
|
||||
|
||||
refresh_game_cfg();
|
||||
try {
|
||||
refresh_game_cfg();
|
||||
} catch(config::error&) {
|
||||
reset_game_cfg();
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
const binary_paths_manager bin_paths_manager(game_config_);
|
||||
|
|
Loading…
Add table
Reference in a new issue