summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMarcel Admiraal <madmiraal@users.noreply.github.com>2020-09-14 18:19:38 +0100
committerMarcel Admiraal <madmiraal@users.noreply.github.com>2020-09-14 18:43:21 +0100
commit7e73dd0b2e29eb99b112482806e483cf37d16a63 (patch)
tree8b591256c37612276ecd8b37178b958bd2fc4577
parentc5f7a581f7247f599b07b0346062db39e52c7d5a (diff)
Fix RigidBodyBullet areasWhereIam 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;