fix problem with team abilities and merging configs

This commit is contained in:
Dominic Bolin 2006-05-15 13:21:01 +00:00
parent 13a890f8d4
commit caba258c8f
2 changed files with 3 additions and 2 deletions

View file

@ -551,7 +551,7 @@ config config::merge_with(const config& c) const
if(itor != n.children.end() && index < itor->second.size()) {
*(itor->second[index]) = itor->second[index]->merge_with(*item);
} else {
if(j + 1 == i->second.end() && index >= last_index) {
if(j + 1 == i->second.end() && itor != n.children.end() && index >= last_index) {
break;
}
n.add_child(i->first,*item);

View file

@ -99,7 +99,8 @@ namespace unit_abilities {
bool affects_side(const config& cfg, const std::vector<team>& teams, size_t side, size_t other_side)
{
return ((cfg["affect_allies"] == "" || utils::string_bool(cfg["affect_allies"])) && !teams[side-1].is_enemy(other_side))
return ((cfg["affect_allies"] == "" || utils::string_bool(cfg["affect_allies"])) && side == other_side)
|| (utils::string_bool(cfg["affect_allies"]) && !teams[side-1].is_enemy(other_side))
|| (utils::string_bool(cfg["affect_enemies"]) && teams[side-1].is_enemy(other_side));
}