diff options
| author | Pedro J. Estébanez | 2017-07-25 04:10:29 +0200 |
|---|---|---|
| committer | Pedro J. Estébanez | 2017-07-25 04:45:01 +0200 |
| commit | 507b48179f773d6495ce62947c7f55564fde4a67 (patch) | |
| tree | 0c1817e886a626ed282aee376b423142bd629dbf /servers/physics_2d | |
| parent | fa1049b46bd1d8b9c6b75b815fa503ecc2811bf0 (diff) | |
| download | godot-507b48179f773d6495ce62947c7f55564fde4a67.tar.gz godot-507b48179f773d6495ce62947c7f55564fde4a67.tar.zst godot-507b48179f773d6495ce62947c7f55564fde4a67.zip | |
Diffstat (limited to 'servers/physics_2d')
| -rw-r--r-- | servers/physics_2d/broad_phase_2d_hash_grid.cpp | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/servers/physics_2d/broad_phase_2d_hash_grid.cpp b/servers/physics_2d/broad_phase_2d_hash_grid.cpp index 5b6c7e2f3..0330bfa9f 100644 --- a/servers/physics_2d/broad_phase_2d_hash_grid.cpp +++ b/servers/physics_2d/broad_phase_2d_hash_grid.cpp @@ -203,9 +203,11 @@ void BroadPhase2DHashGrid::_exit_grid(Element *p_elem, const Rect2 &p_rect, bool if (sz.width * sz.height > large_object_min_surface) { //unpair all elements, instead of checking all, just check what is already paired, so we at least save from checking static vs static - for (Map<Element *, PairData *>::Element *E = p_elem->paired.front(); E; E = E->next()) { - + Map<Element *, PairData *>::Element *E = p_elem->paired.front(); + while (E) { + Map<Element *, PairData *>::Element *next = E->next(); _unpair_attempt(p_elem, E->key()); + E = next; } if (large_elements[p_elem].dec() == 0) { |
