Merge pull request #44695 from madmiraal/fix-44632
Remove all elements from monitored_bodies and monitored_areas when processed
This commit is contained in:
commit
2bd89ac249
2 changed files with 12 additions and 4 deletions
|
@ -215,7 +215,9 @@ void Area2DSW::call_queries() {
|
||||||
|
|
||||||
for (Map<BodyKey, BodyState>::Element *E = monitored_bodies.front(); E;) {
|
for (Map<BodyKey, BodyState>::Element *E = monitored_bodies.front(); E;) {
|
||||||
if (E->get().state == 0) { // Nothing happened
|
if (E->get().state == 0) { // Nothing happened
|
||||||
E = E->next();
|
Map<BodyKey, BodyState>::Element *next = E->next();
|
||||||
|
monitored_bodies.erase(E);
|
||||||
|
E = next;
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -250,7 +252,9 @@ void Area2DSW::call_queries() {
|
||||||
|
|
||||||
for (Map<BodyKey, BodyState>::Element *E = monitored_areas.front(); E;) {
|
for (Map<BodyKey, BodyState>::Element *E = monitored_areas.front(); E;) {
|
||||||
if (E->get().state == 0) { // Nothing happened
|
if (E->get().state == 0) { // Nothing happened
|
||||||
E = E->next();
|
Map<BodyKey, BodyState>::Element *next = E->next();
|
||||||
|
monitored_areas.erase(E);
|
||||||
|
E = next;
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -215,7 +215,9 @@ void Area3DSW::call_queries() {
|
||||||
|
|
||||||
for (Map<BodyKey, BodyState>::Element *E = monitored_bodies.front(); E;) {
|
for (Map<BodyKey, BodyState>::Element *E = monitored_bodies.front(); E;) {
|
||||||
if (E->get().state == 0) { // Nothing happened
|
if (E->get().state == 0) { // Nothing happened
|
||||||
E = E->next();
|
Map<BodyKey, BodyState>::Element *next = E->next();
|
||||||
|
monitored_bodies.erase(E);
|
||||||
|
E = next;
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -250,7 +252,9 @@ void Area3DSW::call_queries() {
|
||||||
|
|
||||||
for (Map<BodyKey, BodyState>::Element *E = monitored_areas.front(); E;) {
|
for (Map<BodyKey, BodyState>::Element *E = monitored_areas.front(); E;) {
|
||||||
if (E->get().state == 0) { // Nothing happened
|
if (E->get().state == 0) { // Nothing happened
|
||||||
E = E->next();
|
Map<BodyKey, BodyState>::Element *next = E->next();
|
||||||
|
monitored_areas.erase(E);
|
||||||
|
E = next;
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue