summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRĂ©mi Verschelde <rverschelde@gmail.com>2020-09-15 09:13:15 +0200
committerGitHub <noreply@github.com>2020-09-15 09:13:15 +0200
commit3a8a0bc5d3098dae3e2daddf1880cf1a55d7080b (patch)
treed73becfe6fb82a40f804f61a97d10e56b211ff8d
parentee36e08c2656a64dede15d8681b0c4c7db55efee (diff)
parent7e73dd0b2e29eb99b112482806e483cf37d16a63 (diff)
Merge pull request #42061 from madmiraal/fix-41743
Fix Bullet prioritised list of Areas a RigidBody is a member of element shift.
-rw-r--r--modules/bullet/rigid_body_bullet.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/modules/bullet/rigid_body_bullet.cpp b/modules/bullet/rigid_body_bullet.cpp
index 32c3240a35..f517eecf64 100644
--- a/modules/bullet/rigid_body_bullet.cpp
+++ b/modules/bullet/rigid_body_bullet.cpp
@@ -849,8 +849,8 @@ void RigidBodyBullet::on_enter_area(AreaBullet *p_area) {
} else {
if (areasWhereIam[i]->get_spOv_priority() > p_area->get_spOv_priority()) {
// The position was found, just shift all elements
- for (int j = i; j < areaWhereIamCount; ++j) {
- areasWhereIam[j + 1] = areasWhereIam[j];
+ for (int j = areaWhereIamCount; j > i; j--) {
+ areasWhereIam[j] = areasWhereIam[j - 1];
}
areasWhereIam[i] = p_area;
break;