Skip to content

Commit

Permalink
fix assertionfailue on invalid [campaign]first_scenario=
Browse files Browse the repository at this point in the history
it's still not optimal, but it's better than assertion failure.
  • Loading branch information
gfgtdf committed Sep 12, 2014
1 parent 7b069b2 commit 162b781
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions src/singleplayer.cpp
Expand Up @@ -81,6 +81,7 @@ bool enter_create_mode(game_display& disp, const config& game_config,
// didn't find any campaign with that id
if (not_found)
{
//TODO: use ERR_NG or similar
std::cerr<<"No such campaign id to jump to: ["<<jump_to_campaign.campaign_id_<<"]\n";
return false;
}
Expand All @@ -107,6 +108,12 @@ bool enter_create_mode(game_display& disp, const config& game_config,
create_eng.prepare_for_new_level();

create_eng.get_parameters();
if(!state.valid())
{
//TODO: use ERR_NG or similar
std::cerr << "Cannot load scenario with id=" << state.get_scenario_id() << "\n";
return false;
}

configure_canceled = !enter_configure_mode(disp, resources::config_manager->game_config(),
state, jump_to_campaign, local_players_only);
Expand Down

0 comments on commit 162b781

Please sign in to comment.