Merge pull request #44696 from madmiraal/fix-44632-3.2

[3.x] Remove all elements from monitored_bodies and monitored_areas when processed
This commit is contained in:
Rémi Verschelde 2021-03-26 16:34:27 +01:00 committed by GitHub
commit ab4c73604d
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 12 additions and 4 deletions

View file

@ -192,7 +192,9 @@ void AreaSW::call_queries() {
for (Map<BodyKey, BodyState>::Element *E = monitored_bodies.front(); E;) {
if (E->get().state == 0) { // Nothing happened
E = E->next();
Map<BodyKey, BodyState>::Element *next = E->next();
monitored_bodies.erase(E);
E = next;
continue;
}
@ -228,7 +230,9 @@ void AreaSW::call_queries() {
for (Map<BodyKey, BodyState>::Element *E = monitored_areas.front(); E;) {
if (E->get().state == 0) { // Nothing happened
E = E->next();
Map<BodyKey, BodyState>::Element *next = E->next();
monitored_areas.erase(E);
E = next;
continue;
}

View file

@ -192,7 +192,9 @@ void Area2DSW::call_queries() {
for (Map<BodyKey, BodyState>::Element *E = monitored_bodies.front(); E;) {
if (E->get().state == 0) { // Nothing happened
E = E->next();
Map<BodyKey, BodyState>::Element *next = E->next();
monitored_bodies.erase(E);
E = next;
continue;
}
@ -228,7 +230,9 @@ void Area2DSW::call_queries() {
for (Map<BodyKey, BodyState>::Element *E = monitored_areas.front(); E;) {
if (E->get().state == 0) { // Nothing happened
E = E->next();
Map<BodyKey, BodyState>::Element *next = E->next();
monitored_areas.erase(E);
E = next;
continue;
}