removed the unused [neighbour_unit_filter] from animations,

SUF does it for us, and does it better
This commit is contained in:
Jérémy Rosen 2007-09-01 06:28:43 +00:00
parent 450b0cbefb
commit 79c20ac42f
3 changed files with 2 additions and 24 deletions

View file

@ -14,6 +14,8 @@ Version 1.3.7+svn:
a game to avoid ambiguity in case of multiple games with the same name
* WML engine:
* now tag [filter_adjacent] is supported in the Standard Unit Filter
* remove the unused [neighbour_unit_filter] animation filter, now that SUF
does it for us (and better)
* graphics:
* new graphics for the highwayman
* miscellaneous and bug fixes

View file

@ -133,9 +133,6 @@ unit_animation::unit_animation(const config& cfg,const std::string frame_string
}
frequency_ = atoi(cfg["frequency"].c_str());
for(itor = cfg.child_range("neighbour_unit_filter").first; itor <cfg.child_range("neighbour_unit_filter").second;itor++) {
neighbour_unit_filter_.push_back(**itor);
}
std::vector<std::string> value_str = utils::split(cfg["value"]);
std::vector<std::string>::iterator value;
for(value=value_str.begin() ; value != value_str.end() ; value++) {
@ -203,26 +200,6 @@ int unit_animation::matches(const game_display& disp, const gamemap::location& l
}
if(unit == disp.get_const_units().end()) return MATCH_FAIL;
}
if(!neighbour_unit_filter_.empty()) {
gamemap::location neighbour_loc[6] ;
get_adjacent_tiles(loc,neighbour_loc);
unit_map::const_iterator unit;
std::vector<config>::const_iterator second_itor;
for(second_itor = neighbour_unit_filter_.begin(); second_itor != neighbour_unit_filter_.end(); second_itor++) {
bool found = false;
for(unit=disp.get_const_units().begin() ; unit != disp.get_const_units().end() ; unit++) {
for(int dir =0; dir < 6 ;dir++) {
if(unit->first == neighbour_loc[dir]) {
if(unit->second.matches_filter(&(*second_itor),neighbour_loc[dir])) {
result++;
found=true;
}
}
}
}
if(!found) return MATCH_FAIL;
}
}
} else if (!unit_filter_.empty()) return MATCH_FAIL;
if(frequency_ && !(rand()%frequency_)) return MATCH_FAIL;

View file

@ -43,7 +43,6 @@ class unit_animation:public animated<unit_frame>
t_translation::t_list terrain_types_;
std::vector<config> unit_filter_;
std::vector<config> secondary_unit_filter_;
std::vector<config> neighbour_unit_filter_;
std::vector<gamemap::location::DIRECTION> directions;
int frequency_;
int base_score_;