You've already forked godot
mirror of
https://github.com/godotengine/godot.git
synced 2026-01-05 19:31:35 +00:00
Remove all elements from monitored_bodies and monitored_areas when processed
This commit is contained in:
@@ -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;
|
||||
}
|
||||
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user