diff options
author | RĂ©mi Verschelde <rverschelde@gmail.com> | 2020-06-09 13:38:05 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-06-09 13:38:05 +0200 |
commit | 945ed76adb2bf54b1535f03047f642daa79f2cff (patch) | |
tree | 2fe96622edc2f4a501293d12241c4e6ef2c6555a /servers/physics_3d/broad_phase_3d_basic.cpp | |
parent | 532942c019c8fcfa565093a77a8cffc572be8e9c (diff) | |
parent | a44252674472787a15ac3e1b458eb7e6f91afa3c (diff) |
Merge pull request #39399 from madmiraal/fix-39374
Test collision mask before creating constraint pair in Godot physics broadphase 2D and 3D.
Diffstat (limited to 'servers/physics_3d/broad_phase_3d_basic.cpp')
-rw-r--r-- | servers/physics_3d/broad_phase_3d_basic.cpp | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/servers/physics_3d/broad_phase_3d_basic.cpp b/servers/physics_3d/broad_phase_3d_basic.cpp index 0f271b33af..f5ea1897a9 100644 --- a/servers/physics_3d/broad_phase_3d_basic.cpp +++ b/servers/physics_3d/broad_phase_3d_basic.cpp @@ -190,8 +190,10 @@ void BroadPhase3DBasic::update() { void *data = nullptr; if (pair_callback) { data = pair_callback(elem_A->owner, elem_A->subindex, elem_B->owner, elem_B->subindex, unpair_userdata); + if (data) { + pair_map.insert(key, data); + } } - pair_map.insert(key, data); } } } |