Merge pull request #70365 from lawnjelly/octree_pairing_fix

Fix pairing crash in physics Octree
This commit is contained in:
Rémi Verschelde 2022-12-22 08:56:30 +01:00
commit 39edf7ee8a
No known key found for this signature in database
GPG key ID: C3336907360768E1

View file

@ -85,19 +85,6 @@ void *BroadPhaseOctree::_pair_callback(void *self, OctreeElementID p_A, Collisio
}
bool valid_collision_pair = p_object_A->test_collision_mask(p_object_B);
void *pair_data = bpo->pair_userdata;
if (pair_data) {
// Checking an existing pair.
if (valid_collision_pair) {
// Nothing to do, pair is still valid.
return pair_data;
} else {
// Logical collision not valid anymore, unpair.
_unpair_callback(self, p_A, p_object_A, subindex_A, p_B, p_object_B, subindex_B, pair_data);
return nullptr;
}
}
if (!valid_collision_pair) {
return nullptr;