Merge pull request #36512 from AndreaCatania/AndreaCatania-patch-2

Fixed remove region method.
This commit is contained in:
Rémi Verschelde 2020-02-25 20:11:19 +01:00 committed by GitHub
commit 2ead439370
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);
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 {