Remove unused code
This code would cause OOS if it was used.
This commit is contained in:
parent
ffe5cd44e3
commit
acabc9201d
1 changed files with 1 additions and 20 deletions
|
@ -259,26 +259,7 @@ protected:
|
|||
|
||||
// If this side tag describes the leader of the side
|
||||
if (!side_cfg_["no_leader"].to_bool() && side_cfg_["controller"] != "null") {
|
||||
if (side_cfg_["type"] == "random") {
|
||||
std::vector<std::string> types = utils::split(side_cfg_["random_leader"]);
|
||||
if (types.empty())
|
||||
types = utils::split(side_cfg_["leader"]);
|
||||
if (types.empty()) {
|
||||
utils::string_map i18n_symbols;
|
||||
i18n_symbols["faction"] = side_cfg_["name"];
|
||||
throw config::error(vgettext("Unable to find a leader type for faction $faction", i18n_symbols));
|
||||
}
|
||||
// "leader", "random_leader" are generated by the mp code
|
||||
|
||||
// using rand() here looks like OOS to me.
|
||||
// since i don't get oos, i wonder whether this is 'dead code' ?
|
||||
WRN_NG_TC << "found [side] type=\"random\" \n"; //warning to find out whether this is dead code.
|
||||
const int choice = rand() % types.size();
|
||||
config leader = side_cfg_;
|
||||
leader["type"] = types[choice];
|
||||
handle_leader(leader);
|
||||
} else
|
||||
handle_leader(side_cfg_);
|
||||
handle_leader(side_cfg_);
|
||||
}
|
||||
BOOST_FOREACH(const config &l, side_cfg_.child_range("leader")) {
|
||||
handle_leader(l);
|
||||
|
|
Loading…
Add table
Reference in a new issue