change a silent error check into an assertion

This commit is contained in:
Patrick Parker 2007-12-10 03:42:17 +00:00
parent 8f54188a39
commit fbf763568f

View file

@ -162,7 +162,8 @@ bool terrain_filter::match_internal(const gamemap::location& loc, const bool ign
} else if(lookup->second) {
++match_count;
}
} else if(index < std::distance(cache_.adjacent_matches->begin(), cache_.adjacent_matches->end())) {
} else {
assert(index < std::distance(cache_.adjacent_matches->begin(), cache_.adjacent_matches->end()));
std::set<gamemap::location> &amc = (*cache_.adjacent_matches)[index];
if(amc.find(adj) != amc.end()) {
++match_count;