Throw error when attempting to play a scenario with zero sides...

...since this doesn't make any sense. (fix for bug #17995)
This commit is contained in:
Anonymissimus 2011-05-03 17:04:09 +00:00
parent 8630b06389
commit 093453cb18

View file

@ -216,8 +216,10 @@ void play_controller::init(CVideo& video){
gamestate_.build_team_stage_two(tb_ptr);
}
// mouse_handler expects at least one team for linger mode to work.
if (teams_.empty()) end_level_data_.linger_mode = false;
if (teams_.empty()) {
throw game::game_error("The scenario is invalid, it has no sides!");
}
LOG_NG << "loading units..." << (SDL_GetTicks() - ticks_) << "\n";
loadscreen::start_stage("load units");