merge 2006-07-27T13:11:54Z!benoit.timbert@free.fr:

sample_ai should no longer crash the game if the recruitment list of
the faction is empty.
This commit is contained in:
Benoît Timbert 2006-07-27 13:15:34 +00:00
parent 0afb158715
commit e32933a6c5

View File

@ -148,6 +148,7 @@ protected:
void do_recruitment() {
const std::set<std::string>& options = current_team().recruits();
if (!options.empty()) {
const int choice = (rand()%options.size());
std::set<std::string>::const_iterator i = options.begin();
std::advance(i,choice);
@ -157,6 +158,7 @@ protected:
do_recruitment();
}
}
}
};
std::vector<std::string> get_available_ais()