Fixed remove region method.

This commit is contained in:
Andrea Catania 2020-02-24 18:09:14 +01:00 committed by GitHub
parent a24aafcb92
commit c16711b155
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -545,8 +545,11 @@ void NavMap::add_region(NavRegion *p_region) {
}
void NavMap::remove_region(NavRegion *p_region) {
regions.push_back(p_region);
regenerate_links = true;
std::vector<NavRegion *>::iterator it = std::find(regions.begin(), regions.end(), p_region);
if (it != regions.end()) {
regions.erase(it);
regenerate_links = true;
}
}
bool NavMap::has_agent(RvoAgent *agent) const {