Merge pull request #42062 from madmiraal/fix-41743-3.2

[3.2] 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 10:19:15 +02:00 committed by GitHub
commit e1856aaa92
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 2 additions and 2 deletions

View File

@ -858,8 +858,8 @@ void RigidBodyBullet::on_enter_area(AreaBullet *p_area) {
} else { } else {
if (areasWhereIam[i]->get_spOv_priority() > p_area->get_spOv_priority()) { if (areasWhereIam[i]->get_spOv_priority() > p_area->get_spOv_priority()) {
// The position was found, just shift all elements // The position was found, just shift all elements
for (int j = i; j < areaWhereIamCount; ++j) { for (int j = areaWhereIamCount; j > i; j--) {
areasWhereIam.write[j + 1] = areasWhereIam[j]; areasWhereIam.write[j] = areasWhereIam[j - 1];
} }
areasWhereIam.write[i] = p_area; areasWhereIam.write[i] = p_area;
break; break;