Merge pull request #42061 from madmiraal/fix-41743

Fix Bullet prioritised list of Areas a RigidBody is a member of element shift.
This commit is contained in:
Rémi Verschelde 2020-09-15 09:13:15 +02:00 committed by GitHub
commit 3a8a0bc5d3
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -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;